php mail problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
abdabs
Forum Newbie
Posts: 7
Joined: Tue Aug 08, 2006 6:26 am

php mail problems

Post 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); 
?>
corkman
Forum Newbie
Posts: 14
Joined: Thu Apr 09, 2009 3:40 am

Re: php mail problems

Post 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
Post Reply