9three Posted October 11, 2009 Share Posted October 11, 2009 Hey, I'm using the mail function to send emails but they are all landing in the spam folder. I've tried different emails and they all land in the spam/junk folder. I'm sending HTML as well. I hope thats not causing it to send the email to the spam folder. $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'To: '.$toname.' <'.$toemail.'>,' . "\r\n"; $headers .= 'From: xxxxx.com <noreply@xxxxx.com>' . "\r\n"; if(mail($toemail, $subject, $msg, $headers)) return true; else return false; Those are the headers I use, I'm not sure if there is something extra I need to put in? Quote Link to comment https://forums.phpfreaks.com/topic/177329-mail-function-sends-to-spam/ Share on other sites More sharing options...
jon23d Posted October 11, 2009 Share Posted October 11, 2009 If it isn't coming from a fully qualified domain name, then this is not surprising. Try using SMTP instead. Quote Link to comment https://forums.phpfreaks.com/topic/177329-mail-function-sends-to-spam/#findComment-935002 Share on other sites More sharing options...
9three Posted October 11, 2009 Author Share Posted October 11, 2009 It is coming from a qualified domain name. Quote Link to comment https://forums.phpfreaks.com/topic/177329-mail-function-sends-to-spam/#findComment-935003 Share on other sites More sharing options...
PFMaBiSmAd Posted October 11, 2009 Share Posted October 11, 2009 http://www.phpfreaks.com/forums/index.php/topic,269373.msg1284757.html#msg1284757 Quote Link to comment https://forums.phpfreaks.com/topic/177329-mail-function-sends-to-spam/#findComment-935072 Share on other sites More sharing options...
grissom Posted October 11, 2009 Share Posted October 11, 2009 Does the return e-mail address noreply@xxxxx.com actually exist ? If not, set it up. Quote Link to comment https://forums.phpfreaks.com/topic/177329-mail-function-sends-to-spam/#findComment-935100 Share on other sites More sharing options...
9three Posted October 11, 2009 Author Share Posted October 11, 2009 I removed the domain on purpose. I'll try what PFMaBiSmAd posted. Quote Link to comment https://forums.phpfreaks.com/topic/177329-mail-function-sends-to-spam/#findComment-935112 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.