News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen:
Sending an HTML with text alternative email with ZendMail
November 02, 2012 @ 10:26:20

Rob Allen has a quick tutorial posted to his site today showing you how to send an email with the ZendMail component of the Zend Framework 2 that contains HTML but provides a plain text backup in the same message.

Sending a multi-part email with ZendMail 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!

The rest of the post is the code you'll need to send a simple email with a text and HTML body sections, configure the headers (to, from, etc) and the "multipart/alternative" header to make the HTML or plain text switching work correctly.

0 comments voice your opinion now!
zendframework2 mail tutorial send alternative html plaintext


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: The ABC's of PHP - Part 10 - The Final Installment (XML & Regex)

Zend Developer Zone: Tutorial : Using Zend Framework Without PDO

PHPMaster.com: Database Interaction Made Easy with NotORM

Zend Developer Zone: Build an Enterprise-Grade PHP Stack with Zend Server 5.0 and Oracle 11g

Thomas Weinert: Building A Sensor Phalanx With PHP


Community Events











Don't see your event here?
Let us know!


performance overview database hack symfony2 application podcast component release facebook composer framework install hhvm unittest package security language opinion introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework