1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect1 id="zend.mail.different-transports">
4 <title>Using Different Transports</title>
7 In case you want to send different e-mails through different connections, you can also pass
8 the transport object directly to <methodname>send()</methodname> without a prior call to
9 <methodname>setDefaultTransport()</methodname>. The passed object will override the default
10 transport for the actual <methodname>send()</methodname> request.
13 <example id="zend.mail.different-transports.example-1">
14 <title>Using Different Transports</title>
16 <programlisting language="php"><![CDATA[
17 $mail = new Zend_Mail();
19 $tr1 = new Zend_Mail_Transport_Smtp('server@example.com');
20 $tr2 = new Zend_Mail_Transport_Smtp('other_server@example.com');
23 $mail->send(); // use default again
28 <title>Additional transports</title>
31 Additional transports can be written by implementing
32 <classname>Zend_Mail_Transport_Interface</classname>.