Zend Framework offers the Zend\Mail
library to send and receive e-mails. In this section, we will cover the basics of Zend Framework's mailing capabilities, and will also implement a simple mailing script.
Zend\Mail
supports both plain text and MIME complaint multipart e-mail messages. The framework by default supports Sendmail, SMTP, and File transports; new transports can be implemented using Zend\Mail\Transport\TransportInterface
.
The Mail
transport is used to send the e-mail message to recipients; Zend\Mail
supports the following transports:
Sendmail using
Zend\Mail\Transport\Sendmail
SMTP using
Zend\Mail\Transport\Smtp
File Transport using
Zend\Mail\Transport\File
The Mail
transport implements the send()
method; this method accepts an object of type
Zend\Mail\Message
as the parameter; this object (Zend\Mail\Message
) contains all the necessary information for an e-mail message; the message is sent using the transport.