【问题标题】:swiftmailer Auth issues with hotmailhotmail 的 swiftmailer 身份验证问题
【发布时间】:2016-09-09 18:25:53
【问题描述】:

我已经搜索了高和低,我似乎找不到使用 hotmail smtp 的 swiftmailer 脚本的工作示例,我尝试在示例中使用 google 并更新端口、用户和密码,但页面会一直挂起,直到超时。

我的代码:

  require_once 'lib/swift_required.php';
// Create the SMTP configuration
$transport = Swift_SmtpTransport::newInstance("smtp.live.com", 465, "TLS");
$transport->setUsername("xxxx@hotmail.com");
$transport->setPassword("XXXXXX");

// Create the message
$message = Swift_Message::newInstance();
$message->setTo(array(
   "XXXX@company.com" => "xxx",
));
$message->setCc(array("another@fake.com" => "Aurelio De Rosa"));
$message->setBcc(array("boss@bank.com" => "Bank Boss"));
$message->setSubject("This email is sent using Swift Mailer");
$message->setBody("You're our best client ever.");
$message->setFrom("XXXXX", "XX XXXXXXX");


// Send the email
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message, $failedRecipients);

// Show failed recipients
print_r($failedRecipients);

【问题讨论】:

    标签: php phpmailer swiftmailer


    【解决方案1】:

    我希望您需要正确设置加密参数。对于端口 465,使用ssl;对于 587,tls。 hotmail 与其他任何地方都没有什么不同 - 您的代码在任何地方都不起作用。

    【讨论】:

    • 感谢您的回复和信息,我已经更新了脚本并尝试了使用 ssl 的 465 和使用 tls 的 587,两者都导致连接超时 #110。还有其他我应该注意的设置或配置吗?
    猜你喜欢
    • 1970-01-01
    • 2013-04-29
    • 2013-07-23
    • 2015-08-25
    • 2010-11-17
    • 2019-06-19
    • 2018-10-08
    • 2011-02-14
    相关资源
    最近更新 更多