Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm looking to start using an SMTP or mail relay service. I've found quite a few out there, but I'm not sure if there are advantages to one vs another. The only requirements I have are:

  • can send "from" more than 1 domain (possibly >20 for all the different sites I work on)
  • can pay for a higher limit (I may need to send as many as 15000 in 1 day, although the average is <500)
  • can send from PHP (although I doubt this will be a problem as most are compatible with any language)

I'm okay with an SMTP service, mail relay service or a site that uses a custom API, although an API would make the conversion more difficult.

Mostly I'd use the server for sending out individual emails, like a registration confirmation or similar. Although once in a while, I might need it to send out a mass email to up to 15000 email addresses.

Reasons for wanting to do this:

  • I don't want to host any mail services my self as they just cause head aches
  • I don't have to worry about being blacklisted. If they are blacklisted they will know about it and have the knowledge to get it fixed.
  • Reporting on if emails have gone through would be nice.
share|improve this question

3 Answers 3

Pretty much any ISP will satisfy these needs, but you will have to pay for it.

What you essentially need to do is setup a local MTA (e.g. exim or postfix) to run in smarthost mode, where it forwards all messages to another mail server (the mail server from the ISP). Your local mail server would be configured not to relay anything other than messages from local sockets (which is the default configuration for exim). This will prevent any of the headaches you want to avoid.

Since you are actually sending mail through a local MTA, you could use the PEAR library for PHP to do it (works very well and supports different "FROM" domains and addresses, in difference to the standard PHP mail function). This also supports plain text messages and HTML messages (probably useful by the sounds of your question).

You will have to get a mail account for each domain individually (at least with most ISPs that I know). If you are not happy to pay for it, then I am afraid you will have to run the mail service yourself (with all that stuff that comes with it).

share|improve this answer
    
This is a great option, but I don't want to use run my own even it if does just relay it to another server. I want to find a service that I can connect to directly. –  Darryl Hein Aug 30 '10 at 12:29
    
I have never tried this, but you should be able to configure the PEAR mailer to connect to another mail server via SMTP. That essentially cuts the local relay completely our of the loop. –  wolfgangsz Aug 30 '10 at 13:07
    
Just checked it. The PEAR mailer has an SMTP class, which can send to any SMTP host. So this will do the trick for you. One warning: As Docunext has pointed out, this won't do any queuing. If you have a need to send to multiple recipients from a single web page, you should build an internal queue and run the mailer from a cron job, otherwise your page load gets delayed until all the messages are delivered. –  wolfgangsz Aug 30 '10 at 13:16

That is good advice. If you use a local MTA, it will manage the queuing for you - deferred emails will be retried as opposed to... who knows? Plus, you'll also get logging built-in, too! Thus reporting on email delivery status.

If you are using PEAR (or some other library or interface) to send via SMTP, it won't necessarily be able to handle unsuccessful deliveries.

You might want to consider setting up SFP records and DKIM, too, so that your domains, if legitimate, won't directly get associated with one IP or another.

share|improve this answer

The best way is to have your local SMTP server send its mail through a decent relay service that can handle things like domain level throttling, SPF, DKIM, suppression lists, IP whitelisting, black list resolution, etc.... Recent studies by ReturnPath indicate that sometimes up to 50% of email goes undelivered when an MTA in misconfigured. By sending through a reputable relay service like SocketLabs Email On-Demand, you can offload the complications, and just focus on your core business.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.