来自本地主机果酱站点的Zend SMTP

时间:2019-01-21 17:06:38

标签: zend-framework

我正在尝试使用ZEND SMTP从本地测试环境发送邮件。当我在网站堵塞下方使用代码时,ik似乎正在循环播放。有什么想法吗?

use Zend\Mail\Transport\Smtp as SmtpTransport;
use Zend\Mail\Transport\SmtpOptions;
use Zend\Mail;
use Zend\Mail\Message;

    $message = new Message();
    $message->addTo('test@hotmail.com')
            ->addFrom('test@host.nl')
            ->setSubject('Greetings and Salutations!')
            ->setBody("Sorry, I'm going to be late today!");

            // Setup SMTP transport using LOGIN authentication
            $transport = new SmtpTransport();
            $options   = new SmtpOptions(array(
                'name'              => 'smtphost',
                'host'              => 'smtphost',
                'port'              => 465,
                'connection_class'  => 'login',
                'connection_config' => array(
                    'username' => 'test@host.nl',
                    'password' => 'password',
                    'ssl' => 'ssl',
                ),
            ));
        $transport->setOptions($options);
        $transport->send($message);

0 个答案:

没有答案