【发布时间】:2016-03-03 10:24:12
【问题描述】:
当我想通过 Swiftmailer for Symfony2 使用 Outlook 发送电子邮件时,连接超时...
无法与主机 smtp-mail.outlook.com 建立连接 [连接超时 #110]
我在这里和互联网上阅读了很多东西,但没有任何效果...... 但是我尝试使用该帐户设置 Thunderbird,并且它起作用了(软件使用 STARTTLS 而不是 TLS)。
这是我的参数:
dev_mailer_transport: smtp
dev_mailer_host: smtp-mail.outlook.com
dev_mailer_port: 587
dev_mailer_user: USERNAME
dev_mailer_password: PASSWORD
这是我的配置:
swiftmailer:
encryption: tls
auth_mode: login
这是用于发送电子邮件的代码:
$message = \Swift_Message::newInstance()
->setSubject($subject)
->setFrom("no-reply@test.com")
->setTo($data["email"])
->setBody(nl2br($content), 'text/html');
$this->container->get('mailer')->send($message);
【问题讨论】:
标签: php symfony email outlook swiftmailer