使用不同的Transport对象
有时你想想使用不同的连接来发送不同的邮件,你也可以不预先调用 Example #1 使用不同的Transport对象 <?php
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
// build message...
require_once 'Zend/Mail/Transport/Smtp.php';
$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?>
|