You are here: sending html email « PHP Language « IT news, forums, messages
sending html email

Posted by gagal on 07/17/07 22:52

The email doesn't actually get sent. Help please.

<?PHP
include("../includes/connect.txt");

$sql = "SELECT * FROM $db_table4";
$result = mysql_query ($sql, $connect) or die ('Query failed:
' .mysql_error());

while ($row = mysql_fetch_array($result))
{
$firstname = $row["firstName"];
$lastname = $row["lastName"];
$to = $row['email1'];
$to .= $row['email2'];
$dob = $row['dob'];
$month = substr($dob,0,2);
$day = substr($dob,3,2);
$currentmonth = date("m");
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: lynettesmith@gmail.com' . "\r\n";
$headers .= 'Reply-To: shivetwins@gmail.com' . "\r\n";
$from = "lynettesmith@gmail.com";
$subject = "Happy Birthday!";
$message =
"<HTML>
<HEAD>
<TITLE>Happy Birthday!</TITLE>
</HEAD>
<BODY>
Hi $firstname,
<BR>
<DIV ALIGN='center'><I>
As you celebrate this day
<BR>
Remember the simple
<BR>
Things in life
<BR>
A loving heart
<BR>
A warm smile
<BR>
The look that shows you care
<BR>
So with the warmest of wishes
<BR>
Happy Birthday for this year and many, many more!
<BR><BR>
Lynne
</I></DIV>
</BODY>
</HTML>";
if ($month == $currentmonth && $month != 00 )
{
if(mail($to, $subject, $message, $headers))
echo "Mail sent to $firstname<BR>";
else
echo "Mail send failure - message not sent to $fristname $lastname.";
}
}
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация