SMTP 身份验证
Example #1 在 Zend_Mail_Transport_Smtp 中使用身份验证 <?php require_once 'Zend/Mail.php'; require_once 'Zend/Mail/Transport/Smtp.php'; $config = array('auth' => 'login', 'username' => 'myusername', 'password' => 'password'); $transport = new Zend_Mail_Transport_Smtp('mail.server.com', $config); $mail = new Zend_Mail(); $mail->setBodyText('This is the text of the mail.'); $mail->setFrom('sender@test.com', 'Some Sender'); $mail->addTo('recipient@test.com', 'Some Recipient'); $mail->setSubject('TestSubject'); $mail->send($transport);
|