tags:

views:

679

answers:

3

Hi All

I am developing email queue module for my php application. So all emails(user notifications, password reminder ...) will be put into the queue and will send by cron process based on the priority of emails. But i will have news letter module soon. so my question is either to keep newsletter in seperated queue or can be used the centralized queue since i have priority attribute for all emails ?

Thanks.

+2  A: 

If you can do them with the same module, I'd consider that preferable since there's less code to worry about.

The only potential problem I can see is the differing nature of the two email types. User notifications and password reminders would tend to have one recipient. Newsletters would be emailed to all of your users at once.

If this doesn't cause a problem (and you can't see any other problems), I'd stick with the one-mailer-to-rule-them-all approach.

paxdiablo
Thanks Pax for the reply, good advice from your side, i will consider that, got some thoughts.
shuxer
+5  A: 

Word of caution: Do you have experience building email senders? It's a hairy adventure and you're almost always better off outsourcing the task. Email deliverability is not easy or predictable.

You can stick with one queue, but be sure to have the ability to specify which IP address a particular email can be sent from. You'll want to have different IP addresses for sending newsletters, signups, invoices, etc. And even further, you'll want to have an IP for sending newsletters to trusted addresses and untrusted addresses.

Gary Richardson
Gary, Thanks for your comments, actually i don't have much experience on emailing queue, i will definitely take into account your notes. Can you advise me any open source php emailing system(advanced one) that i could follow up ? I just need to know more about the tricks like u mentioned. Thanks.
shuxer
I don't know of any PHP ones. The product I'm most familiar with is Strongmail. I highly recommend it. You could always do a demo to get a feature list :)
Gary Richardson
By the way, im not so sure what "different IP" means, i got it like different smpt/pop3 accounts. If i am wrong can you give me a little bit explanation ? I would really appreciate that. Thanks.
shuxer
different IP addresses -- big ISP's rate incoming mail by how much they trust a particular IP. Fewer complaints with more volume from a particular IP address means higher trust. You're more likely to get mail into the inbox. That's why you segment risky traffic to separate IP's.
Gary Richardson
I got it, Thanks alot!
shuxer
A: 

Hi shuxer, as Gary Richardson mentions, email deliverability can be tricky.

This is not an ad. But I highly recommend PostMarkApp.com. I am not related to that company in any other way than as a paying customer (well, my company pays).

They have a mail delivery system and a API that you can use from your PHP scripts. You just submit your mails to their queue, and they will do the sending and handle spam reports, bouncing, etc. And their API allows you to know which of your messages bounced and handle them.

This service is the equivalent of CampaignMonitor for raw email sending. BTW, you cannot send newsletters through PostMarkApp, they only allow one-to-one emails (like your user notifications and password reminders).

A few years ago I started building my own email delivery script, until the hosting company mentioned there was a maximum of 500 emails per day. Then I used a 'newsletter' delivery system, with some hacky work-arounds to make it do what I wanted. It was a mess.

Until recently, we were also using another custom-made mail-delivery script but, as Gary Richardson said, you need to take into account IPs, bounces, etc. I find the postmark thing so exciting (in a geeky way) it's embarrassing :D

Having said that, once you are outsourcing the actual delivery of your mails, you could have one single mail queue for your system, using your priority levels. In this way, your application would add mails to your own mailing queue, and your mailing system would deliver it to the outsourced platform. This is preferred to trying to send the email straight away during a page refresh after a user presses submit or similar.

PS: If anybody knows of any service similar to postmark, please let me know!

Rafa