Programmer's Reference Guide
| SMTP Authentication |
Securing SMTP Transport
Zend_Mail also supports the use of either TLS or SSL to secure a SMTP connection. This can be enabled be passing the 'ssl' parameter to the configuration array in the Zend_Mail_Transport_Smtp constructor with a value of either 'ssl' or 'tls'. A port can optionally be supplied, otherwise it defaults to 25 for TLS or 465 for SSL.
Example #1 Enabling a secure connection within Zend_Mail_Transport_Smtp
- 'port' => 25); // Optional port number supplied
- $transport = new Zend_Mail_Transport_Smtp('mail.server.com', $config);
- $mail = new Zend_Mail();
- $mail->setBodyText('This is the text of the mail.');
- $mail->setFrom('sender@test.com', 'Some Sender');
- $mail->addTo('recipient@test.com', 'Some Recipient');
- $mail->setSubject('TestSubject');
- $mail->send($transport);
| SMTP Authentication |
Add A Comment
Please do not report issues via comments; use the ZF Issue Tracker.
If you have a JIRA/Crowd account, we suggest you login first before commenting.
Select a Version
Languages Available
Components
Search the Manual
Navigation
- Programmer's Reference Guide
- Programmer's Reference Guide
- Zend Framework Reference
- 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

Comments