拒绝连接#111 stream_socket_client():无法连接到SwiftMailer中的ssl://ssl0.ovh.net:465

时间:2019-04-11 18:25:13

标签: php symfony ssl smtp swiftmailer

我尝试将具有smtp连接的电子邮件发送到我的smtp客户端。 我尝试使用带SSL连接的PHPMailer,它可以正常工作!! 但不是Symfony 4.2中的SwiftMailer ...

它用于运行PHP 7.2.14的Symfony 4.2。

这是我尝试通过swiftmailer发送电子邮件时的日志...

我尽力了

select()

这是我的swiftmailer.yaml

[2019-04-11 20:09:49] php.DEBUG: Warning: stream_socket_client(): unable to connect to ssl://ssl0.ovh.net:465 (Connection refused) {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\SilencedErrorContext: {\"severity\":2,\"file\":\"/home/mielleriem/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php\",\"line\":267,\"trace\":[{\"file\":\"/home/mielleriem/www/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php\",\"line\":58,\"function\":\"establishSocketConnection\",\"class\":\"Swift_Transport_StreamBuffer\",\"type\":\"->\"}],\"count\":1})"} []
[2019-04-11 20:09:49] app.ERROR: Exception occurred while flushing email queue: Connection could not be established with host ssl0.ovh.net [Connection refused #111] [] []

在我的.env中,我把这一行

swiftmailer:
    transport: smtp
    host: ssl0.ovh.net
    port: 465
    auth_mode: login
    encryption: ssl
    #auth_mode: login
    username: admin@*****-a****he.fr
    password: ********
    #intercept_redirects: true
    # disable_delivery: false
    # url: '%env(MAILER_URL)%'
    spool: { type: 'memory' }

这是我的第一个.htaccess

MAILER_URL=null://localhost

和我的第二个

#SetEnv SHORT_OPEN_TAGS 0
#SetEnv REGISTER_GLOBALS 0
#SetEnv MAGIC_QUOTES 0
#SetEnv SESSION_AUTOSTART 0
#SetEnv ZEND_OPTIMIZER 1
#SetEnv PHP_VER 7_2

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L]

0 个答案:

没有答案
相关问题