sage Posted April 9, 2007 Share Posted April 9, 2007 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 More sharing options...
neel_basu Posted April 9, 2007 Share Posted April 9, 2007 Use the mail class it will recognise your content as HTML automatically and Send teh HTML email. http://zigmoyd.sourceforge.net/man/mail.php#mailBut Please Read The Installtion and Instruction Page First Link to comment https://forums.phpfreaks.com/topic/46242-error-on-sendmailphp/#findComment-224930 Share on other sites More sharing options...
Lumio Posted April 9, 2007 Share Posted April 9, 2007 That "error" is because of the class, not because of your code. We can't help you without the code of that class. But I think it's because of the header. Look: http://www.phpfreaks.com/quickcode/easy-code-to-send-HTML-emails-via-PHP/545.php Link to comment https://forums.phpfreaks.com/topic/46242-error-on-sendmailphp/#findComment-224938 Share on other sites More sharing options...
neel_basu Posted April 9, 2007 Share Posted April 9, 2007 BUt He isn't Using Any Class. i.e. I didn't See any classes in his code Link to comment https://forums.phpfreaks.com/topic/46242-error-on-sendmailphp/#findComment-225032 Share on other sites More sharing options...
Lumio Posted April 9, 2007 Share Posted April 9, 2007 sendmail is not a default function of php. It has to be defined by another file. Okay... he isn't using a class. That's true. Link to comment https://forums.phpfreaks.com/topic/46242-error-on-sendmailphp/#findComment-225039 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.