elmas156 Posted December 14, 2010 Share Posted December 14, 2010 Hello everyone, I have website that uses the php(mail) function to notify users when something happens on their account. The site was created for a school district so all the users are district employees where their incoming email is subject to pretty strict spam filtering. I am using headers to indicate to the recipient that the email is coming from support@mysite.com, but I guess the mail servers see past this and recognize that it's coming from a php(mail) function. Because of this, all of the emails being sent are being blocked by the filter. I've tried adding all emails coming from an address that ends with "@mysite.com" but this doesn't work. This is what the addresses look like that the spam filter is actually seeing: elmas156@p3nlhftpg049.shr.prod.phx3.secureserver.net And I can't just add a single address to the white list because each time an email is sent, the letters and numbers after "@" and before "secureserver.net" are different. Here's another address that shows up: elmas156@p3nlhg331.shr.prod.phx3.secureserver.net here is the code that I'm using to send the emails: <?php $sendto = "$email"; $emailsubject = "Testing Message Report For $cdate."; $emailmessage = "This is a test email."; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: MySite.com Report <support@mysite.com>' . "\r\n"; // Mail it mail($sendto, $emailsubject, $emailmessage, $headers); ?> Does anyone have any suggestions on what to do to make every email sent to be recognized by the spam filter as coming from the same email instead of a bunch of random ones? I hope this is making sense to someone because it was very difficult for me to explain in writing. Thanks in advance for any help or suggestions. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 14, 2010 Share Posted December 14, 2010 You can try using the optional fifth parameter to pass a flag to the email program on your host (usually sendmail or exim) to set the message envelope address: <?php $fifthp = '-f support@mysite.com'; mail($sendto, $emailsubject, $emailmessage, $headers, $fifthp); ?> This may not work on all hosts. Ken Quote Link to comment Share on other sites More sharing options...
elmas156 Posted December 14, 2010 Author Share Posted December 14, 2010 I'm getting this error now: Parse error: syntax error, unexpected T_STRING in /home/content/29/6879529/html/mysite/newmsg.php on line 85 this is line 85: mail($sendto, $emailsubject, $emailmessage, $headers, $fromaddress); any ideas? Quote Link to comment Share on other sites More sharing options...
elmas156 Posted December 14, 2010 Author Share Posted December 14, 2010 Never mind... I figured out that I left out a semi-colon on line 84 ;-) I think this did the trick. Thanks very much for your help. Quote Link to comment 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.