在 Zend 框架上通过 SMTP 发送电子邮件

2021-12-29 00:00:00 email smtp php zend-framework
$config = array('auth' => 'login',
                'username' => '****@gmail.com',
                'password' => '****',
                'port' => '25',
                'ssl' => 'tls');


$transport = new Zend_Mail_Transport_Smtp('smtp.googlemail.com', $config);

那之后我该怎么办,我可以把正文和收件人地址放在哪里.

what should i do after that, where can i put the body and the recipient address.

推荐答案

在Zendframework

Zend_Mail::setDefaultTransport($transport);

然后在其他地方实例化 Zend_Mail,编写您的邮件并发送.

Then somewhere else instanciate Zend_Mail, write your mail and send it.

相关文章