从邮件php函数发送电子邮件时隐藏服务器(Hide server when sending email from mail php function)

编程入门 行业动态 更新时间:2024-10-28 21:22:50
从邮件php函数发送电子邮件时隐藏服务器(Hide server when sending email from mail php function)

全部,我有以下代码:

$to = $friend_email[$x]; $subject = "Subject"; $message = "This is a message"; $from = $your_email; $headers = "From:" . $from; mail($to,$subject,$message,$headers);

当电子邮件发送时(我正在使用Godaddy的托管服务)它正确地说出来然后在gmail中它通过pxnlhgxxx.prod.xhx3.secureserver.net说。 反正有没有隐藏via部分或让它说像website.com? 谢谢您的帮助。

All, I have the following code:

$to = $friend_email[$x]; $subject = "Subject"; $message = "This is a message"; $from = $your_email; $headers = "From:" . $from; mail($to,$subject,$message,$headers);

When the email sends (I'm using Godaddy's hosting service) it says From correctly but then in gmail it says via pxnlhgxxx.prod.xhx3.secureserver.net. Is there anyway to hide the via part or make it say something like website.com? Thanks for the help.

最满意答案

根据mail()文档,您可以为函数使用可选的第5个参数,并将您要伪装的服务器的名称传递为:

mail($to, $subject, $message, $headers, "-f sender@website.com");

As per the mail() docs, you use the optional 5th parameter for the function and pass in the name of the server you'd like to masquerade as:

mail($to, $subject, $message, $headers, "-f sender@website.com");

更多推荐

本文发布于:2023-08-07 20:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465791.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   发送电子邮件   邮件   服务器   Hide

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!