Forum Moderators: coopster
<?php
include ($_SERVER 'DOCUMENT_ROOT'] . "/verify.php"); // this sets up $member_email
$to = $member_email;
$from = "me@website.com";
$subject = "Test Mail from me";
$message = "
<html>
<body bgcolor='#DCEEFC'>
<div align='center'>
<img src='http://www.website.com/gfx/img.png' width='233' height='94' alt='alt text' border='0' />
<b>This is an HTML email.</b> <br>
<font color='red'>Good stuff!</font> <br>
</body>
</html>";
//end of message
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-Type: text/html\r\n";
$headers.= "From: $from\r\n";
mail($to, $subject, $message, $headers);
echo "Message has been sent!";
?>
FB manage to make their emails look very graphical before you even click to display images.
<!DOCTYPE html><html><head></head><body><div></div></body></html>
<?php
include ($_SERVER['DOCUMENT_ROOT'] . "/verify.php"); // this sets up $member_name
$to = $member_email;
$from = "me@website.com";
$subject = "Test Mail from Me";
//begin of HTML message
$message = "
<html>
<body bgcolor=\"#DCEEFC\">
<div align='center'>
<img src='http://www.website.com/gfx/img.jpg' width='233' height='94' alt='alt_text' border='0'>
<br /><b>Rock! This is an HTML email.</b> <br />
<font color='red'>Thanks Groover!</font> <br />
<a href='http://www.website.com'>Let the people Rule</a><p></p>
</div>
<p>Now I can send HTML Email <br /> Regards</p>
<br />Me<br />
</body>
</html>";
//end of message
// To send the HTML mail we need to set the Content-type header.
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-Type: text/html\r\n";
$headers.= "From: $from\r\n";
//options to send to cc+bcc
//$headers .= "Cc: [email]email@website.com[/email]";
//$headers .= "Bcc: [email]email@website.com[/email]";
// now lets send the email.
mail($to, $subject, $message, $headers);
echo "Message has been sent!";
?>