简体   繁体   English

使用gmail发送电子邮件在Laravel中花费的时间太长

[英]Sending email using gmail is taking too long in laravel

I am done with my set up . 我的设置已经完成。 mail sending is also working properly but taking to much time to send the mail. 邮件发送也可以正常工作,但是要花很多时间发送邮件。

Plz tell me way by which i can fix this issue . 请告诉我解决此问题的方法。

Use queues https://laravel.com/docs/5.6/queues The mail will be added to queue and sent later. 使用队列https://laravel.com/docs/5.6/queues邮件将被添加到队列中,并在以后发送。 Does not need client to wait for request to finish. 不需要客户端等待请求完成。

Unless you run multiple workers in parallel. 除非您并行运行多个工作程序。 If your SMTP server's connection takes a second, you'll send 10 emails per second if you have 10 workers. 如果您的SMTP服务器的连接需要一秒钟,那么如果您有10名工作人员,则每秒将发送10封电子邮件。 But check with your IT to see if they aren't throttling by IP addresses. 但是请与您的IT部门联系,以查看它们是否不受IP地址的限制。

But honestly, either your IT looks at why their SMTP server can't send emails fast enough, or you look at using an external server to do your mass mailing. 但说实话,您的IT部门正在研究其SMTP服务器为什么不能足够快地发送电子邮件,或者您正在使用外部服务器进行群发邮件。

So i suggest you that please change your SMTP Server. 因此,我建议您更改SMTP服务器。 It may be help you. 可能会对您有所帮助。

For more information : 欲获得更多信息 :

https://www.reddit.com/r/laravel/comments/6e7knm/mail_facade_very_slow_sending_email_with_local/ https://www.reddit.com/r/laravel/comments/6e7knm/mail_facade_very_slow_sending_email_with_local/

https://learninglaravel.net/learn-to-send-emails-using-gmail-and-sendgrid-in-laravel-5 https://learninglaravel.net/learn-to-send-emails-using-gmail-and-sendgrid-in-laravel-5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM