Php – A more flexible way of sending emails in PHP

emailPHP

I'm looking to integrate some email features into my system, and I'm not too impressed by using mail() to send mails, as the function is quite limited in what it can do.

Ideally, I'd like a framework or something I can integrate into my system, that would allow me to generate the messages in my own way, and then send them off.

A couple of other features that would be really nice:

  • Queue system, so emails can be throttled nice and simply.
  • Light weight, with minimum dependancies
  • Supports plain and html email, as well as any number of attachments.

Best Answer

Most frameworks have there own Mail objects that can be used to create messages.

I personally like Zend_Mail, as it's part of the Zend Framework, which is loosely coupled, so it can be used inside the Framework, or used as a stand alone.

You can read more about it here: http://framework.zend.com/manual/en/zend.mail.html

It definitely meets your second and third requirement. I don't think anything is going to fulfill all three requirements, because your first requirement, of a queuing system, would require tight integration with a server.

If you are looking for something to queue up messages, you might want to look for a newsletter system, but I haven't found a good open source Php one.