Re: Confirmation email caught by spam filter
| From: | LAMP | Date: | Wed, 27 May 2009 17:27:06 +0000 |
| Subject: | Re: Confirmation email caught by spam filter | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293225@lists.php.net to get a copy of this message | ||
Andrew Ballard wrote:
On Wed, May 27, 2009 at 12:07 PM, LAMP <lamp@afan.net> wrote:right. the "5th element" was wwwrun@... (return-path) I added on the end of the mail() '-forders@mydomain.com' Though, where/how can I setup the get bounced emails? Shouldn't bounced email be sent to "return-path"? I just sent few emails with non-existing email addresses and didn't get anything back?hi, I use the following code (from php.net) to send confirmation email to the person that just created an account:What mail program is PHP using? Did you check out the $additional_parameters (5th parameter) for the mail() function? If you're using sendmail and the envelope from address is 'nobody@mydomain.com', you can pretty much assume they will get dumped as SPAM regardless of what you set in the From: header. Andrew$headers = "MIME-Versin: 1.0\n" . "Content-type: text/plain; charset=ISO-8859-1;format=flowed\n" ."Content-Transfer-Encoding: 8bit\n" . "Reply-To: Orders <lamp@afan.net>\n". "From: Orders <orders@mydomain.com>\n" . "X-Mailer: PHP" . phpversion(); mail($to, $subject,$body, $headers); $subject is something like "[MyDomain] Your new account", and $body is just few plain text details about person who created the form. The same code I use to reset a password: a visitor enters his/her email address and the link with session ID is sent to entered email address. The problem is the confirmation emails and "reset password" emails are very often caught by email filter and finish in Spam/Junk folder, or even stopped by ISP. What am I doing wrong, or what to do to improve the code? Also, how can I get bounced emails? Thanks, Afan