2. Use mail queue
1. Config Email
System Admin -> Email Setting -> config Email
Note: Default, the function to send email with forgotten passwords is always activated when the sending mail function is on.
+ Server SMTP: is the IP or domain of the provider. For example
+ Account SMTP: is the user smtp. For example with gmail:
+ Password SMTP: Your password is provided
+ Security SMTP: Usually a vendor-specific
TLS / SSL
+ Port SMTP: is the port to send mail, usually
25, 465, 587
2. Use email queue
By default, the sending of the mail will be made immediately after each move. However, if your application has a lot of accesses, the slow mail delivery process will affect the user experience on the website because you have to wait for the response results.
- To overcome the above problem, you can enable sure to send mail through queue.
- Sending mail will be moved to the job table instead of being sent directly. This way, your application will not have to wait for a response from sending mail
A crontab will automatically send emails in the job table, and delete them when completed. The work will not affect the customer experience on the website application.
- Note: You must install crontab for your application.
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1