tags:

views:

202

answers:

3

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)?

A: 

This all depends on the web host and what they offer for SMTP. You need to check with your web host for the SMTP IP or server name. Most likely, it's the same POP3 outgoing SMTP information they give you for the e-mail accounts associated with your domain.

HardCode
+3  A: 

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.

Jeff Sternal
A: 

A linux server should provide a program called sendmail (though it may well be implemented by exim or postfix), and this program will handle all the queueing, retry, and so on. You will need to provide some sort of return address to handle bounces from invalid addresses and so on.

If you get more sophisticated in your email needs, and if you control what's installed on the server, you might want to look into Daniel J Bernstein's qmail program, but it is set up to help sophisticated users with heavy email loads, and your question suggests you are not there yet.

Norman Ramsey