By
constant referrals to the Domain Name System (DNS) the mail transfer agents work backwards through the
Licensed to Menshu You
Zend Framework in Action (Ch010) Manning Publications Co. 3
email address until they arrive at the local domain. At each stage the actual path taken is determined by the
availability of servers, successfully passing firewalls, spam and virus filters.
So far we've only gone through an overview of the workings of email and there are still more details we
need to cover, but at this point it's a good time to start looking at the main reason we're here; Zend_Mail. As
well as going into some of its features, from this point on we will focus on some of the details of email that
Zend_Mail can take care of.
9.2 Introducing Zend_Mail
While the previous section portrayed Zend_Mail as having a fairly minor role in the overall process it is
nonetheless a pivotal one. Not only can Zend_Mail be used to send mail via sendmail or SMTP, it can also
compose them, add attachments, send HTML formatted email and even read mail messages.
9.2.1 Creating emails with Zend_Mail
The very least an email needs to have for Zend_Mail to send it is a sender, a recipient and a message body. In
Listing 9.1 we can see how that bare minimum, plus a subject header, is perfectly adequate for Bert to get his
invite sent to Ernie.
Pages:
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248