Jump to content

Error on sendmail.php


sage

Recommended Posts

I need some help on this.... basically this is my sendmail.php file.... and the problem is tht when it calls for the email file(dbemail.html).. it sends the email file so all the html codes show up in tht email. It gets all the content of the file tht is the source code. it does not show the html email.... The ob function gets all the content source code not the html format and i cant find a suitable function so as to send the email in html.. pls help ???


<?


//== Set subject and message
$subject="Hey,?"; //put your subject in PHP Alphanumeric Format e.g. "Hello. This is a test..."
$msgfile="dbemail.html"; //enter the filename which points to your mail content file in html format e.g. "mailmessage.html"

//========================== do not edit beyond this line
ob_start(); require($msgfile); $message=ob_get_contents(); ob_end_clean();

//== End retrieval

$email = @$_POST['email'];
if(!$email){$email = array();}

foreach ($email as $emailaddress) {
if(@sendmail($emailaddress,$subject,$message)){
  echo htmlspecialchars($emailaddress,ENT_QUOTES)."– <b>Mail Sent Successfully</b><br/>";
}else{
  echo htmlspecialchars($emailaddress,ENT_QUOTES)."– <b>Send Mail Failed</b><br/>";
}
}

print "<div class=\"pd\"><b>Total of ".count($email)." selected email addresses retrieved</b></div>";
?>

Link to comment
https://forums.phpfreaks.com/topic/46242-error-on-sendmailphp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.