Zend_Mail-DifferentTransports.xml 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.mail.different-transports">
  4. <title>Using Different Transports</title>
  5. <para>
  6. In case you want to send different e-mails through different connections, you can also pass the
  7. transport object directly to <code>send()</code> without a prior call to
  8. <code>setDefaultTransport()</code>. The passed object will override the default transport for the
  9. actual <code>send()</code> request.
  10. </para>
  11. <example id="zend.mail.different-transports.example-1">
  12. <title>Using Different Transports</title>
  13. <programlisting language="php"><![CDATA[
  14. $mail = new Zend_Mail();
  15. // build message...
  16. $tr1 = new Zend_Mail_Transport_Smtp('server@example.com');
  17. $tr2 = new Zend_Mail_Transport_Smtp('other_server@example.com');
  18. $mail->send($tr1);
  19. $mail->send($tr2);
  20. $mail->send(); // use default again
  21. ]]></programlisting>
  22. </example>
  23. <note>
  24. <title>Additional transports</title>
  25. <para>
  26. Additional transports can be written by implementing <classname>Zend_Mail_Transport_Interface</classname>.
  27. </para>
  28. </note>
  29. </sect1>
  30. <!--
  31. vim:se ts=4 sw=4 et:
  32. -->