Page 1 of 1

php mail problems

Posted: Thu Apr 09, 2009 4:53 am
by abdabs
I've problems that my php mailing system allways ends up in my clients spam/junk box.. what are the tricks to avoid it? Underneath follows code.. settings; http://www.esge.org/php.php

Thanks!

Code: Select all

<? 
    $header .= "Reply-To: Some One <someone@mydomain.com>\r\n"; 
    $header .= "Return-Path: Some One <someone@mydomain.com>\r\n"; 
    $header .= "From: Some One <mydomain@myhost.com>\r\n"; 
    $header .= "Organization: My Organization\r\n"; 
    $header .= "Content-Type: text/plain\r\n"; 
 
    mail("recipient@recipient-domain.com", "Test Message", "This is my message.", $header); 
?>

Re: php mail problems

Posted: Thu Apr 09, 2009 5:44 am
by corkman
Spam folder is for automatically generated messages. Your mesasge has been geenrated by computer, that's why it is there. Having a php mailer for an user agent is a big minus, you will have to overweight it with perfectly written message body, otherwise it will always end in junk.

The only way I know how to beat it, is with using socket functions and communicating with smtp server directly and faking the user agent, otherwise there is always in message headers "X-Mailer: PHP", which may be enough for some spam filters to consider the message as bulk. But faking user agent is not enough, you will have to write good body to pass all the spam filters.

Check for exapmle this:
http://www.dreamincode.net/forums/showtopic36108.htm