Jump to content

php(mail) function and SPAM filters


elmas156

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.