Chapter 6. Mailing

The more technologically advanced the medium, the more primitive, trivial and useless messages are transmitted through it.

Stanisław Lem


  • Sending plain text and HTML-formatted e-mail.

  • Including attachments and adding carbon copies.

  • Configuring SMTP servers and setting secure connections.

  • Overview of the most popular mailing engines.

E-mail predates the first web pages and even the Internet itself, and compared to other web technologies, mailing has not changed much over the years. However e-mail is still the backbone of all advanced web services and the Internet could not work without it. Apart from user-to-user communication, mailing is indispensable for creating accounts, reminding users about passwords they've forgotten, sending newsletters, keeping up with newsgroups, and so on.

You can't develop web apps without mailing, and this chapter explains how to do it efficiently and effortlessly. Using the mailing engines presented here is easy and straightforward, so this chapter will be a piece of cake for you — a piece of very nutritious cake, in fact, taking into account how many beneficial uses of mailing there are.


Developers need to make sure that e-mail is automated and works as designed. Most of the commonly encountered problems are associated with the following:

  • Establishing connections

  • Sending HTML-formatted e-mail

  • Sending e-mail to multiple receivers

  • Carbon copies

All these problems can be easily solved with mailers. ...

Get Building PHP Applications with Symfony™, CakePHP, and Zend® Framework now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.