我的 PHP MAILER 功能有问题。我正在使用 GMAIL SMTP 身份验证来发送电子邮件,并且它工作得很好,但我想将“发件人”电子邮件设置为“[电子邮件受保护] /cdn-cgi/l/email-protection“但它无法正常工作。
我使用下面的代码来设置“发件人”电子邮件
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.gmail.com"; // SMTP server
$mail->SMTPDebug = 0; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "test@gmail.com"; // GMAIL username
$mail->Password = "test@123";
$mail->SetFrom("[email protected] /cdn-cgi/l/email-protection","Domian");
它向我显示默认电子邮件[电子邮件受保护] /cdn-cgi/l/email-protection代替[电子邮件受保护] /cdn-cgi/l/email-protection
请帮帮我。
提前致谢!
Gmail 会重写通过 smtp.gmail.com 发送的邮件的标头,将发件人地址替换为与您用于发送邮件的 Gmail 帐户关联的 Gmail 地址。有关详细信息和可能的解决方法,请参阅:http://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server http://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)