Programmer's Reference Guide
| Using Different Transports |
HTML E-Mail
To send an e-mail in HTML format, set the body using the method setBodyHTML() instead of
setBodyText(). The MIME content type will automatically be set to text/html
then. If you use both HTML and Text bodies, a multipart/alternative MIME message will automatically be
generated:
Example #1 Sending HTML E-Mail
$mail = new Zend_Mail();
$mail->setBodyText('My Nice Test Text');
$mail->setBodyHtml('My Nice <b>Test</b> Text');
$mail->setFrom('somebody@example.com', 'Some Sender');
$mail->addTo('somebody_else@example.com', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send();
| Using Different Transports |
Select a Version
Languages Available
Components
Search the Manual
Navigation
- Programmer's Reference Guide
- Programmer's Reference Guide
- Zend_Mail
- Introduction
- Sending via SMTP
- Sending Multiple Mails per SMTP Connection
- Using Different Transports
- HTML E-Mail
- Attachments
- Adding Recipients
- Controlling the MIME Boundary
- Additional Headers
- Character Sets
- Encoding
- SMTP Authentication
- Securing SMTP Transport
- Reading Mail Messages
