[英]how can I specify the domain on outgoing PHP mail on a server hosting 2 domains?
My server is configured with example.net
as the hostname, but both example.net
and domain.com
A records point to the IP. 我的服务器配置了
example.net
作为主机名,但是example.net
和domain.com
A记录均指向IP。
If you visit domain.com
one of the pages sends an email out. 如果您访问
domain.com
其中一个页面会发送一封电子邮件。 I've tried this 我已经试过了
mail('my@email.com',
'an image (#' . $id . ') has been reported',
'an image (#' . $id . ') has been reported',
'From: reports@domain.com' . "\r\n" . 'Reply-To: reports@domain.com' . "\r\n" .
'Return-Path: reports@domain.com');
When sending it to my Live/Hotmail address, it gets sent to the junk folder, and this is what message source
shows 将其发送到我的Live / Hotmail地址时,它将发送到垃圾文件夹,这是
message source
显示的内容
Authentication-Results: hotmail.com;
spf=none (sender IP is *.*.*.*) smtp.mailfrom=www-data@example.net;
dkim=none header.d=domain.com;
x-hmca=none header.id=reports@domain.com
From: reports@domain.com
Reply-To: reports@domain.com
Return-Path: www-data@example.net
If you're on a *nix server, using sendmail, then you can specify the sender used in the SMTP transmission by passing extra arguments to sendmail via the fifth parameter, eg: 如果您在* nix服务器上,使用sendmail,则可以通过第五个参数将额外的参数传递给sendmail ,从而指定SMTP传输中使用的发件人,例如:
mail('my@email.com',
'an image (#' . $id . ') has been reported',
'an image (#' . $id . ') has been reported',
'From: reports@domain.com' . "\r\n" . 'Reply-To: reports@domain.com' . "\r\n" .
'Return-Path: reports@domain.com',
'-freports@domain.com');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.