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 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog
    • ¥15 Excel发现不可读取的内容
    • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题