gpt4 book ai didi

PHP 邮件发送到手机/短信/短信;缺少来自、通过 header

转载 作者:行者123 更新时间:2023-11-29 14:53:29 26 4
gpt4 key购买 nike

由于某种原因,当 php mail() 发送到文本号码(通过电子邮件)时,即 123456789@vtext.com;发件人显示为 centos apache 服务器输出电子邮件 (apache@host-name.com)。但是,我已经包含了正确的标题;因此,当将相同的 mail() 推送到(例如)gmail 时,它会显示正常,并且具有所有正确的 header /mime 类型/来源。

有什么想法吗?

这是普通邮件的代码

$headers = "From: Alert@thedomain.com \r\n";
$headers .= "Date: ". date('r') . "\r\n";
$headers .= "Content-Type: text/html; charset=utf-8";
$headers .= "MIME-Version: 1.0 ";
$body = "body message";
mail($userinfo->username,"thedomain",$body,$headers);

以及移动设备的代码:(我们不使用日期/内容类型/mime 作为文本消息,否则标题会显示在 txt 消息中)

$headers = "From: Alert@thedomain.com \r\n";    
$body = "body message";
mail($userinfo->mobile,"thedomain",$body,$headers);

最佳答案

尝试使用附加的 -f 标志发送到邮件功能:

mail($userinfo->username,"thedomain",$body,$headers, "-ffromaddress@example.com");

See the manual有关其他参数的更多信息

关于PHP 邮件发送到手机/短信/短信;缺少来自、通过 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5207323/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com