Rob Allen blogs on sending mail with Zend\Mail

      No Comments on Rob Allen blogs on sending mail with Zend\Mail

Over on his blog, Zend Framework master Rob “Akrabat” Allen has a short post titled Sending an HTML with text alternative email with Zend\Mail.

Sending a multi-part email with Zend\Mail is easy enough, but if you want to send an HTML email with a text alternative, you need to remember to set the content-type in the headers to multipart/alternative. As this is the second time I had to work this out, I’m noting it here for the next time I forget!

That quote is quite literally the entire non-code portion of the code. (It’s what we call long on the HOW short on the WHY) The rest of the post gives you all kinds of cut-n-paste goodness to get you going. If you are working with Zend Framework, this is one you will want to bookmark. This is one of those posts that you know you are going to need eventually, even if you don’t right now.