开发者

exim4 vs gmail FROM field

开发者 https://www.devze.com 2023-02-13 21:12 出处:网络
I\'ve configured exim开发者_高级运维 on my server as MTA to work with gmail. Here is a configuration:

I've configured exim开发者_高级运维 on my server as MTA to work with gmail. Here is a configuration:

gmail_login:
       driver = plaintext
       public_name = LOGIN
       client_send = : myaccount1@gmail.com : mypassword

The configuration is OK and I'm able to send a mail using a php script:

$to      = 'myaccount3@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: myaccount2@gmail.com' . "\r\n" .
    'Reply-To: myaccount2@gmail.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

if (mail($to, $subject, $message, $headers)) {
  echo 'mail() Success!' . "<br />\n";
}
else {
  echo 'mail() Failure!' . "<br />\n";
}

However I've encountered an issue:

gmail shows myaccount1@gmail.com in the FROM field instead of the actual email specified in the FROM field in my script (myaccount2@gmail.com). The reply-to field is OK.

Please, help to solve the issue.


Gmail overwrites any FROM value you specify. Gmail overwrites it with the authenticated FROM value.

0

精彩评论

暂无评论...
验证码 换一张
取 消