[HELP] PHP Mail going to Junk?

Status
Not open for further replies.

Thom

You can't touch this
Oct 1, 2010
1,305
386
Hai! I am messing about with PHP Mail, and I was wondering what headers I would need to use to stop it going to the junk/spam parts of many emails.

Any help is appreciated! Thanks!
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,926
3,921
I use the following headers:
PHP:
        $headers  = 'From: ' . $from . ' <' . $email . '>' . "\r\n";
        $headers .= 'Reply-To: ' . $email . "\r\n";
        $headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
        $headers .= 'MIME-Version: 1.0';
 

Thom

You can't touch this
Oct 1, 2010
1,305
386
I use the following headers:
PHP:
        $headers  = 'From: ' . $from . ' <' . $email . '>' . "\r\n";
        $headers .= 'Reply-To: ' . $email . "\r\n";
        $headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
        $headers .= 'MIME-Version: 1.0';
$from and $email are what?
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
I was having a similar problem earlier in work. I added this line of code and it seemed work:

PHP:
ini_set( "sendmail_from", "[email protected]" );

Change '[email protected]' to whatever email you're sending from. Try putting that in a global file and including the file in the file with your mailing script. It seemed to work for now.

However now I'm having a different problem -- Microsoft Outlook won't retrieve emails to certain email addresses so I'm trying to figure out why.
 
Status
Not open for further replies.

Users who are viewing this thread

Top