Manual of PHP

 
 
 

Web map

 
rim   rim
arrowReady frontarrow of Codes PHParrow to Send an e-mail HTML with PHP

 

To send an e-mail HTML with PHP To print E-mail

To send an e-mail with PHP is very simple, we have only to use the function mail. But when we write code HTML in the body of the message, we receive this one like text and not like a web page, as we would like. This has easy solution, only we need to add the head "Content-type: text/html" in the e-mail and the code that we should send it will be interpreted as HTML. Let's see as:

<? php

$codigohtml ='

<html>
<head>
<title> E-mail HTML </title>
</head>
<body>
<to href = "http://www.webtaller.com"> to Go to WebTaller </to>
</body>

';

$email = 'pepito@grillo.com';
$asunto = 'E-mail HTML';
$cabeceras = "Content-type: text/html\r\n";

mail ($email, $asunto, $codigohtml, $cabeceras);

?>

Thus the e-mails that we send will be seen like a Web page. In the heads we can add other things, as for example if we want to specify the one who sends the e-mail we will do:

$cabeceras = "From: direccion@email.dom \r\nContent-type: text/html\r\n";

Thus the sender of the e-mail would be direccion@email.dom

For Alex.

 

 
Front
Chapters of the Manual of PHP
Introduction to PHP
Variables
My First Script PHP
Operators in PHP
Structures of Control
Functions in PHP
Code inclusion
Counterfoils (array)
Chains of Characters
Classes
Dates
Entry and Exit
Operations with Files
The language SQL and PHP
Connection with MySQL
Meetings
Forms with PHP
To practise in line
List of practices in line
FAQ
Frequent questions
Codes PHP
List of Codes PHP
Forums
Forums PHP
Other Manuals
Manuals of other languages
 
   
 
 
MySpaceScripts.info - Sitemap - Contact us - Sitemap - Contact us - Sitemap - Contact us

auto brands , Paid to Read Blog , posizionamento Google , car.nice-car.co.uk , Chasse Pologne aux cerfs , Samsung s800 jet , BlackBerry Software