slightbrand Posted January 17, 2012 Share Posted January 17, 2012 Hello I have a problem with my html email - My code can send the email but i can't see the email on my yahoomail or gmail... Here is the code <?php $to = '[email protected]'; $subject = 'Test HTML Email'; $headers = "From: [email protected]\r\n"; $headers .= "Reply-To: [email protected]\r\n"; $headers .= "CC: [email protected]\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message = '<html><body>'; $message .= '<table style="width:100%; border:none;">'; $message .= '<TR> <TD colspan="2"> Thanks for using Mobile Nets</TD> </TR>'; $message .= '<TR><TD style="width:80px;"><b>Name</b></TD><TD> Dummy </TD></TR>'; $message .= '<TR><TD style="width:80px;"><b>Age</b></TD><TD> 16 </TD></TR>'; $message .= '<TR><TD style="width:80px;"><b>Address</b></TD><TD> Address of me </TD></TR>'; $message .= '<TR><TD style="width:80px;"><b>Message</b></TD><TD> Test Email </TD></TR>'; $message .= '</table>'; $message .= '</body></html>'; if(mail($to, $subject, $message, $headers)){ echo "Email Sent"; }else{ echo "Error while trying to send the email"; } ?> Can someone tell me what the problem is? thanks Quote Link to comment https://forums.phpfreaks.com/topic/255237-html-email-problem/ Share on other sites More sharing options...
Muddy_Funster Posted January 17, 2012 Share Posted January 17, 2012 dunno about yahoo, but gmail treats mime html mail as an attachment. try it without the mime header in. Quote Link to comment https://forums.phpfreaks.com/topic/255237-html-email-problem/#findComment-1308645 Share on other sites More sharing options...
Alkimuz Posted January 17, 2012 Share Posted January 17, 2012 maybe a stupid reply, but dit you think of looking into the spam-folders? the email might not come through the spam-filters of yahoo and gmail.. making the email more personal might help.. Quote Link to comment https://forums.phpfreaks.com/topic/255237-html-email-problem/#findComment-1308718 Share on other sites More sharing options...
slightbrand Posted January 18, 2012 Author Share Posted January 18, 2012 Finally my html email work but have problems after seeing the email... The email result that i get is.. <html><body><table style="width:100%; border:none;"><TR> <TD colspan="2"> Thanks for using Mobile Nets</TD> </TR><TR><TD style="width:80px;"><b>Sender</b></TD><TD> +639217195804 </TD></TR><TR><TD style="width:80px;"><b>Date</b></TD><TD> 12/12/12 </TD></TR><TR><TD style="width:80px;"><b>Time</b></TD><TD> 10:30:23 </TD></TR><TR><TD style="width:80px;"><b>Message</b></TD><TD> Test Email </TD></TR></table></body></html> Any ideas why i have this as the result? thanks Quote Link to comment https://forums.phpfreaks.com/topic/255237-html-email-problem/#findComment-1308842 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.