我正在尝试使用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);