| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.mail.different-transports" xmlns:xi="http://www.w3.org/2001/XInclude">
- <title>Using Different Transports</title>
- <para>
- In case you want to send different e-mails through different connections, you can also pass
- the transport object directly to <methodname>send()</methodname> without a prior call to
- <methodname>setDefaultTransport()</methodname>. The passed object will override the default
- transport for the actual <methodname>send()</methodname> request.
- </para>
- <example id="zend.mail.different-transports.example-1">
- <title>Using Different Transports</title>
- <programlisting language="php"><![CDATA[
- $mail = new Zend_Mail();
- // build message...
- $tr1 = new Zend_Mail_Transport_Smtp('server@example.com');
- $tr2 = new Zend_Mail_Transport_Smtp('other_server@example.com');
- $mail->send($tr1);
- $mail->send($tr2);
- $mail->send(); // use default again
- ]]></programlisting>
- </example>
- <note>
- <title>Additional transports</title>
- <para>
- Additional transports can be written by implementing
- <classname>Zend_Mail_Transport_Interface</classname>.
- </para>
- </note>
- <xi:include href="Zend_Mail-UsingFileTransport.xml" />
- </sect1>
- <!--
- vim:se ts=4 sw=4 et:
- -->
|