tags:

views:

82

answers:

2

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.
+3  A: 

Like most holes in core PHP functionality, one option is to fill it with a Zend Framework class. The Zend Framework lets you pick and choose which pieces you use, so dependencies will be minimal. Zend_Mail looks like it will handle your plain text/html/attachment requirement.

As for a queue system, this is only an opinion, but that's not really PHP's job. If you're getting to the point where email is serious enough to you to consider throttling, you'll want to become familiar with sendmail, postfix, or whatever Mail Transfer Agent (MTA) you're using. Almost all PHP classes that wrap mail functionality are actually just sending the message off the the MTA to handle. Any system that implements throttling in PHP is (likely) just going to throttle sending it off the the MTA, and the MTA still ends up being a point of failure.

Alan Storm
+3  A: 

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.

Travis