The code below used to work under PHP 4.0 and that we upgrade to PHP 5, it' no longer working. Will anyone suggest where the problem is and how to fix it?
[code=php]$To = "myEmail@myDomain.com";
$message ='
<html>
<body>
<p><strong>The person '.$txtNmLast.', '.$txtNmFirst.' has successfully updated his/her online profile on '.$updateTime.'.</strong></p>
<table width="900" height="361" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="130" bgcolor="#333366"><strong><font color="#FFFFFF">dirID:</font></strong></td>
<td width="130" bgcolor="#FF9933">'.$txtID.'</td>
<td width="130" bgcolor="#333366"><strong><font color="#FFFFFF">Hide Status:</font></strong></td>
<td width="250" bgcolor="#FF9900">'.$hdStatus.'</td>
<td width="130" bgcolor="#333366"><strong><font color="#FFFFFF">Last Name:</font></strong></td>
<td width="130" bgcolor="#FF9900">'.$txtNmLast.'</td>
</tr>
<tr>
<td bgcolor="#333366"><strong><font color="#FFFFFF">First Name:</font></strong></td>
<td bgcolor="#FF9933">'.$txtNmFirst.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Maiden Name:</font></strong></td>
<td bgcolor="#FF9900">'.$txtMdnName.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Middle Name:</font></strong></td>
<td bgcolor="#FF9900">'.$txtMdlName.'</td>
</tr>
<tr>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Nick Name:</font></strong></td>
<td bgcolor="#FF9933">'.$txtNckName.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">First Major:</font></strong></td>
<td bgcolor="#FF9900">'.$txtFstMajor.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">First Class Off:</font></strong></td>
<td bgcolor="#FF9900">'.$txtFstYear.'</td>
</tr>
<tr>
<td bgcolor="#333366"><strong><font color="#FFFFFF">First Degree:</font></strong></td>
<td bgcolor="#FF9933">'.$txtFstDegree.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Second Major:</font></strong></td>
<td bgcolor="#FF9900">'.$txtSndMajor.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Second Class Off:</font></strong></td>
<td bgcolor="#FF9900">'.$txtSndYear.'</td>
</tr>
<tr>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Second Degree:</font></strong></td>
<td bgcolor="#FF9933">'.$txtSndDegree.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Email:</font></strong></td>
<td bgcolor="#FF9900">'.$txtEmailAddrs.'</td>
<td bgcolor="#333366"><strong><font color="#FFFFFF">Web Site:</font></strong></td>
<td bgcolor="#FF9900">'.$txtWebsiteAddrs.'</td>
</tr>
</table>
</body>
</html>';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
//$headers .= "From: Retrieval Page"." <".$txtEmailAddrs.">\r\n";
$headers .= "From: '".$txtEmailAddrs."'\r\n";
$subject = "My profile update";
mail($To, $subject, $message, $headers);[/code]
The error is:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in F:\wwwroot\home\alumni\updateSuccess.php on line 264
Any help is grateful!
ljCharlie