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