Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Email sending best practice?

Tags:

email

Title sounds a bit weird, but basically I'm wondering how I should go about setting up email sending for some server software I'm writing? Basically the only time I'd send an email is when a user signs up an account or needs their password reset. Do high traffic sites rely on the linux mail app or is there some other method (like queueing or etc)?

like image 825
ryeguy Avatar asked Mar 24 '09 23:03

ryeguy


1 Answers

I recommend saving the outbound message to a database, then queueing the actual delivery so that another application dedicated only to emailing can deal with timeouts and other hazards - and the queue will allow you to recover gracefully from those failures.

What's more, depending on your configuration and the type of message queue platform you're using, you can farm out the email processing to another server or servers so it doesn't compete with your application. Not that emailing is especially resource-intensive, but every bit of flexibility counts when you're busy scaling.

Finally, for another plus, a separate email delivery application that consumes queued messages can service multiple applications.

like image 198
Jeff Sternal Avatar answered Oct 01 '22 16:10

Jeff Sternal