【问题标题】:php email domain namephp邮箱域名
【发布时间】:2014-06-10 20:40:05
【问题描述】:
mail("xxxxx@xxxxxx.com",
    'This is the subject!',
    '<div style="background:black;color:green;width:100%;height:1000px;">Email email message message HEy</div>',
    "Content-type: text/html; charset=iso-8859-1; From: 1234abc"
);

当我将它发送到我的邮件时,它显示为黑色背景和绿色文本。但是From 标头不起作用。它只显示为 apache apache@ns209646.ip-188-165-193.eu,其中 188.165.193.158 是我的服务器 IP 地址。

【问题讨论】:

标签: php email


【解决方案1】:

应使用 CRLF (\r\n) 分隔多个额外的标头。

source

... "Content-type: text/html; charset=iso-8859-1\r\nFrom: 1234abc" ...

【讨论】:

  • 谢谢,但它现在显示为 1234abc@ns209646.ip-188-165-193.eu
  • 请填写完整的电子邮件地址。
【解决方案2】:

应使用 CRLF (\r\n) 分隔多个额外的标头。

$headers = 'From: 1234abc <webmaster@example.com>' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n";

不过我建议使用自动邮件 我使用http://swiftmailer.org/ 并摆脱了由于邮件标题而导致的很多挫败感,从垃圾邮件刺客的观点来看,邮件看起来更好

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-28
    • 2011-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多