SocomNegotiator Posted July 24, 2008 Share Posted July 24, 2008 This email is supposed to be sent to who I say when an order is completed. Now for some reason when I put HTML into the message body it just shows up as normal text in my actual email. Does anybody know how to fix this problem? Code: <?php $to = "[email protected]"; $subject = "You have recieved a new order online from {$userinf['company_name']}"; $message = "<p>{$userinf['contact_name']} from {$userinf['company_name']} has just submitted an order online.<br /></p>"; $from = $user->inf['email']; $headers = "From: $from"; mail($to,$subject,$message,$headers);?> When I go to my email it shows this: <p>John from Costco has just submitted an order online.<br /></p> I don't know why it shows the HTML in the email...any help would be much appreciated. Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/ Share on other sites More sharing options...
MasterACE14 Posted July 24, 2008 Share Posted July 24, 2008 try.... $message = '<p>{$userinf['contact_name']} from {$userinf['company_name']} has just submitted an order online.<br /></p>'; single quote rather then double. Regards ACE Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598299 Share on other sites More sharing options...
ronnie88 Posted July 24, 2008 Share Posted July 24, 2008 nvm master answered Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598303 Share on other sites More sharing options...
MasterACE14 Posted July 24, 2008 Share Posted July 24, 2008 haha, gotta be quick ronnie Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598305 Share on other sites More sharing options...
SocomNegotiator Posted July 24, 2008 Author Share Posted July 24, 2008 try.... $message = '<p>{$userinf['contact_name']} from {$userinf['company_name']} has just submitted an order online.<br /></p>'; single quote rather then double. Regards ACE It still does it no matter if I put single or doubles quotes Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598309 Share on other sites More sharing options...
ronnie88 Posted July 24, 2008 Share Posted July 24, 2008 maybe html doesn't display in emails.... find out the keystring that your email provider uses and try that... Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598317 Share on other sites More sharing options...
MasterACE14 Posted July 24, 2008 Share Posted July 24, 2008 make sure you got HTML enabled in your e-mail software/client. Just in case the script is working fine, and its a problem on your end Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598319 Share on other sites More sharing options...
SocomNegotiator Posted July 24, 2008 Author Share Posted July 24, 2008 Hey guys I had to put this in my header: $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598321 Share on other sites More sharing options...
MasterACE14 Posted July 24, 2008 Share Posted July 24, 2008 that explains it Link to comment https://forums.phpfreaks.com/topic/116359-solved-php-simple-email-problem/#findComment-598323 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.