[英]Laravel Queue, Connection to tcp://smtp.office365.com:587 Timed Out
我正在使用Microsoft outlook SMTP
详细信息从我的网站向其他用户发送电子邮件。
我配置了“队列/作业”功能来发送电子邮件。
SMTP设置
MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=info@abcxyz.com
MAIL_PASSWORD=abcyxz45
MAIL_FROM_NAME=ABC Mailer
MAIL_FROM_EMAIL=info@abcxyz.com
MAIL_ENCRYPTION=tls
分派工作代码
$job = new SendReportEmail($job_data);
$this->dispatch($job);
邮件发送码
class SendReportEmail extends Job implements SelfHandling, ShouldQueue
{
use InteractsWithQueue, SerializesModels;
var $data = null;
public function __construct($data)
{
$this->data = $data;
}
public function handle()
{
$response = $this->data['response'];
$EntrepreneurPdf = $response->pdf;
Mail::send('emailTemplates.imResults', ['response' => $response], function ($message) use ($response, $EntrepreneurPdf) {
$message->subject($response->subject);
$message->to($response->provider_email);
$this->checkForEntrepreneurReportAttachment($response, $message, $EntrepreneurPdf);
});
}
}
当我运行此命令以执行排队作业时
php artisan queue:listen --timeout=300
进程开始了,有时我遇到错误,因此由于错误并一次又一次地排队等待,我多次收到相同的电子邮件。
Processed: Illuminate\\Queue\\CallQueuedHandler@call [Swift_TransportException] Connection to tcp://smtp.office365.com:587 Timed Out
问题何在何处?
在服务器上尝试ping smtp
telnet smtp.office365.com 587
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.