Reputation: 2876
Can any one please advice how do i change the mailing header Return-Path
from <[email protected]>
to [email protected]
, since the notification emails are get into SPAM/JUNK folder.
Note:
I have been advised to change this info on the mail sending code(PHP)
Upvotes: 2
Views: 6927
Reputation: 2023
This is what i do and works every time
mail($to,$subject,$body,'From: [email protected]','-f [email protected]');
Upvotes: 5
Reputation: 219804
In the headers parameters of the mail()
function you can set this:
<?php
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Return-Path: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
Upvotes: 2
Reputation: 146302
Note: I have been advised to change this info on the mail sending code(PHP)
You should follow that advice :-D
Just add a From: [email protected] \r\n
to the header of the mail that will be sent.
Upvotes: -1