从邮件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");更多推荐
发布评论