Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Using Different Transports

In case you want to send different e-mails through different connections, you can also pass the transport object directly to send() without a prior call to setDefaultTransport(). The passed object will override the default transport for the actual send() request.

Example 595. Using Different Transports

= new Zend_Mail();
// build message...
$tr1 = new Zend_Mail_Transport_Smtp('');
$tr2 = new Zend_Mail_Transport_Smtp('');
$mail->send();  // use default again

Additional transports

Additional transports can be written by implementing Zend_Mail_Transport_Interface.

Zend Framework