I recommend saving the outgoing message to the database, and then completing the delivery sequence so that another application, designed only for sending by e-mail, can deal with timeouts and other dangers - and the queue will allow you to elegantly recover from these failures.
What else, depending on your configuration and the type of message queue platform you use, you can process email on another server or servers so that it does not compete with your application. Not that e-mail was particularly resource-intensive, but every bit of flexibility is taken into account when you are busy scaling.
Finally, for another plus point, a single email delivery application that consumes messages in a queue can serve multiple applications.
Jeff sternal
source share