I am developing a site that sends email notifications to users after certain events / user actions (marked in photos, added as friend, etc.).
In my experience, sending emails from a web server can be slow. For example, when creating a new user, I will send an email to confirm / greet the account. However, there is a slight pause, sometimes waiting for the page to load while it finishes sending the email.
My fear is that if I ever have a problem connecting to my mail server or mail server, it will make it difficult to load my application / page
So my question is: what's the best way to send emails from a web application that sends emails on an ongoing basis?
Do I have to create a queue system by storing the contents of the email in the database, and then run the scheduled cron jobs to process all the received emails?
Or do I just need to send an email right after a user completes an action / event (creating a member account marked in the photo, etc.)?
source
share