Any cool web site contains an e-mail process that interacts with the user in one form or another: a signup welcome e-mail, a newsletter, or a barrage of junk mail. I'm sure you've seen them all. No matter which flavor of e-mail you prefer, it has come a long way since the early days of the Web, when text email was the only type you could receive.
This chapter will cover how Zend Framework not only sends the standard text based e-mail but also how it implements MIME types to send HTML messages. Almost every modern web site uses them to communicate effectively with each user in the system—with newsletters or personalized e-mail concerning what the user likes. You will also learn how to determine whether a host accepts e-mail, which is useful when validating an e-mail address; focus on exception handling for times when something unforeseen occurs; and see how to attach files to your e-mail using Zend Framework.
This chapter also builds on the main application: the LoudBite application. You'll expand on the AccountController class by creating a welcome e-mail and then an activation e-mail. You'll then create an HTML newsletter to send to users. For personalizing e-mail, you'll create a newsletter using HTML that is geared to target each user's taste.
The plan is to have you quickly create e-mail messages and then create a small scripts to send the e-mail off to your users using Zend_Mail. This will prepare you for any quick projects you're working on where Zend_Mail can lend a hand. So let's get to it.
Was this article helpful?