note 69462 deleted from ref.mail by colder
| From: | colder@php.net | Date: | Thu, 07 Sep 2006 00:38:58 +0000 |
| Subject: | note 69462 deleted from ref.mail by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-116790@lists.php.net to get a copy of this message | ||
Note Submitter: carlosumanzor at arweb dot com
Reason: in docs
----
This is a small function to send html mail:
<?php
function send_mail($to, $sujet, $msg, $from) {
$headers = "MIME-Version: 1.0\r\n".
"Content-type: text/html; charset=iso-8859-1\r\n".
"From: ".$from."\r\n".
"To: ".$to."\r\n".
"Date: ".date("r")."\r\n".
"Subject: ".$sujet."\r\n";
mail($to, $sujet, $msg, $headers); //ta da !
}
$from= "somebody@somedomain.com"; //It's can exits or not
$msj= "<html><head><title>something</title></head><body>Bla
bla</body></html>"; //You must put the full structure of a html page
send_mail('otherguy@otherdomain.com', "some subject", $msj, $from); //call the
function
?>
It's simple and very easy to use.
Bye