[MANUAL] English:
[zend.git] / documentation / manual / en / module_specs / Zend_Mail-DifferentTransports.xml
blob0491a26c41b9ca2f6abfe7dc22cdf5647f78c80a
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Reviewed: no -->
3 <sect1 id="zend.mail.different-transports">
4     <title>Using Different Transports</title>
6     <para>
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.
11     </para>
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();
18 // build message...
19 $tr1 = new Zend_Mail_Transport_Smtp('server@example.com');
20 $tr2 = new Zend_Mail_Transport_Smtp('other_server@example.com');
21 $mail->send($tr1);
22 $mail->send($tr2);
23 $mail->send();  // use default again
24 ]]></programlisting>
25     </example>
27     <note>
28         <title>Additional transports</title>
30         <para>
31             Additional transports can be written by implementing
32             <classname>Zend_Mail_Transport_Interface</classname>.
33         </para>
34     </note>
35 </sect1>
36 <!--
37 vim:se ts=4 sw=4 et:
38 -->