Shadow Jolteon Posted August 10, 2009 Share Posted August 10, 2009 Hello. =) I have been working on a registration system for my website, and everything is going great, except for the verification email... I have never worked with the mail() function before, and have no idea what I am doing wrong. Whenever I submit the form, it sends the email, but for some reason, the HTML is sent as an attachment to the email, which is blank. $emailHeaders = 'MIME-Version: 1.0'."\r\n"; $emailHeaders .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $emailHeaders .= 'To: '.$registeredName.' <'.$registeredAddress.'>'."\r\n"; $emailHeaders .= 'From: Site Name <[email protected]>'."\r\n"; mail($registeredAddress, 'Account Verification', $emailContent, $emailHeaders); Any help with this would be greatly appreciated. Thanks! =) Link to comment https://forums.phpfreaks.com/topic/169594-trouble-sending-html-email-with-php/ Share on other sites More sharing options...
alexdemers Posted August 10, 2009 Share Posted August 10, 2009 Follow the examples here: PHP: mail - Manual. There's an example with HTML emails. Also, make sure your email client does in fact support HTML emails. If it does, is it turned on for that particular address? Maybe there's a security option in your email client that restricts parsed HTML emails if you don't know the sender. Link to comment https://forums.phpfreaks.com/topic/169594-trouble-sending-html-email-with-php/#findComment-894741 Share on other sites More sharing options...
Shadow Jolteon Posted August 10, 2009 Author Share Posted August 10, 2009 Yeah, I've read through the PHP mail function manual a bunch of times already... =/ And, yes, my email client definitely supports HTML email, and it is turned on. =) I've never had any trouble receiving HTML email in the past, even from unknown senders. Also, I've tested this on two separate clients, just to make sure, and I get the same results... Link to comment https://forums.phpfreaks.com/topic/169594-trouble-sending-html-email-with-php/#findComment-895014 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.