Send an HTML Email Using PHP
PHP Mail Function:
The mail() function allows you to send emails directly from a script.
Syntax For E-mail:
mail($to,$subject,$message,$headers);
[php]
<?php
$to = "someone@example.com, someoneelse@example.com";
$subject = "HTML email ";
$message = "<table><tr><td>Congrats</tr></td></table>";
// Always set content-type when sending HTML email//Very Very Important headers</h4>
$headers = "MIME-Version: 1.0" . "\r\n";</h4>
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";// More headers</h4>
$headers .= ‘From: <webmaster@example.com>’ . "\r\n";
$headers .= ‘Cc: mymd@example.com’ . "\r\n";
mail($to,$subject,$message,$headers);
?>
[/php]
No comments yet.