dousong5492 2019-01-24 04:22 采纳率: 100%
浏览 49

Swiftmailer不会向yahoo.com或icloud.com发送电子邮件

I'm sending confirmation emails using swiftmailer, and it works flawlessly for most domains. For some reason, yahoo.com and icloud.com never receive emails. They aren't in spam/trash - it's as if they've blacklisted my domain, but this is the first time this domain has sent an email to their domains so I'd think that unlikely.

$transport = (new \Swift_SmtpTransport('mail.smtpserver.org', 465, 'ssl'))
    ->setUserName('user@smtpserver.org')
    ->setPassword($email_password);

//Create a Swiftmailer instance
$swift= (new \Swift_Mailer($transport));

//Create content            
$content = "This is only a test. If this were an actual email, you would receive it. But you won't, because your email address is in the yahoo or icloud domain. Tough luck.";

$fromEmail = "user@smtpserver.org";
$fromName = "Same name as in email account on smtpserver.org";

$message = (new \Swift_Message("$fname, Whassup!"))
->setFrom(["$fromEmail" => "$fromName"])
->setTo(["$email" => "$fname, $lname"])
->setBody($content,'text/html')
->addPart(strip_tags($content), 'text/plain');

$swift->send($message);
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题