How to handle Swift_TransportException in Silex

巧了我就是萌 提交于 2019-12-03 22:09:14

Emails are not sent immediately when you call send(), instead they get into a memory spool that is flushed during the application shutdown, when the response has already been sent. This improves the user experience, as the response can be sent much faster.

i had trouble sending mails on my localhost too - i got rid of the exception with this code:

/// config
$app['swiftmailer.options'] = array(
    'host' => 'smtp.1und1.de',
    'port' => '465',
    'username' => 'xxx',
    'password' => 'yyy',
    'encryption' => 'ssl',
    'auth' => 'login',
);

// bootstrap
$app->register(new Silex\Provider\SwiftmailerServiceProvider(), array(
    'swiftmailer.options' => $app['swiftmailer.options']
));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!