I have a website that manages my students grades etc... Parts of the site use the mail() function. Some mail servers are rejecting my emails or putting them into spam folder. I have postfix installed on my web server so I can send mail from the site, but I do not receive email for this domain. So I set the Return-Path and from etc. to my work email address. I am guessing that this may be the reason my email is getting blocked?
Here is a copy of the message header...
From AIT Web Admin Wed Oct 10 03:14:17 2007
Return-Path: <www@mail.myDomain.org>
Authentication-Results: mta214.mail.re3.yahoo.com from=; domainkeys=neutral (no sig)
Received: from IP.OF.MY.SERVER (EHLO mail.myDomain.org) (IP.OF.MY.SERVER)
by mta214.mail.re3.yahoo.com with SMTP; Wed, 10 Oct 2007 03:15:34 -0700
Received: by mail.myDomain.org (Postfix, from userid 33)
id B460B4C0CD5; Wed, 10 Oct 2007 06:14:17 -0400 (EDT)
To: somePerson@theirEmailAddress.com
Subject: Password Changed.
MIME-Version: 1.0
From: Admin <me@myWorkAddress.com>
Reply-To: Admin <me@myWorkAddress.com>
Message-Id: <20071010101417.B460B4C0CD5@mail.myDomain.org>
Date: Wed, 10 Oct 2007 06:14:17 -0400 (EDT)
Content-Length: 606
The php code that handles this is...
$subject = "Password Changed.";
$from = $_CONF['admin_email'];
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "From: Admin <".$from.">\r\n";
$headers .= "Reply-To: Admin <".$from.">\r\n";
$headers .= "Return-Path: <".$from.">\n";
mail($email, $subject, $email_body, $headers);
NOTE: $email, $subject and $email_body are defined or passed to this function...
Is it possible to fool the receiving mail servers to think that the mail is coming from a different server so it doesn't get caught or do I need to modify my headers to match the domain name the mail is really being sent from?
Thanks in advance for taking the time to help me.
Mike