【发布时间】:2011-09-02 15:30:36
【问题描述】:
我正在尝试使用我在此处找到的 CakePHP SwiftMailer 组件发送电子邮件: http://bakery.cakephp.org/articles/sky_l3ppard/2009/11/07/updated-swiftmailer-4-xx-component-with-attachments-and-plugins
我要发送到的服务器在端口 25 上使用带有 TLS 的 SMTP。这是我尝试发送邮件时遇到的错误:
Notice (8): Trying to get property of non-object [APP/views/helpers/hdl_session.php, line 14]
Warning (2): stream_socket_client() [function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number [CORE/vendors/classes/Swift/Transport/StreamBuffer.php, line 271]
Warning (2): stream_socket_client() [function.stream-socket-client]: Failed to enable crypto [CORE/vendors/classes/Swift/Transport/StreamBuffer.php, line 271]
Warning (2): stream_socket_client() [function.stream-socket-client]: unable to connect to tls://mail.aedisit.com:25 (Unknown error) [CORE/vendors/classes/Swift/Transport/StreamBuffer.php, line 271]
Warning (2): Illegal offset type in isset or empty [CORE/cake/libs/i18n.php, line 177]
Warning (2): Cannot modify header information - headers already sent by (output started at /srv/www/stage/hypercool/cake/libs/debugger.php:673) [CORE/cake/libs/controller/controller.php, line 742]
这是来自我的 phpinfo 的 OpenSSL 信息:
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 0.9.8o 01 Jun 2010
OpenSSL Header Version OpenSSL 0.9.8o 01 Jun 2010
还有一些来自我的 phpinfo 的更多信息:
PHP Version 5.3.5-1ubuntu7.2
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
非常感谢这里的任何帮助:-)
编辑:
SSL 操作失败,代码为 1。OpenSSL 错误消息: 错误:1408F10B:SSL 例程:SSL3_GET_RECORD:错误的版本号
这似乎是问题的根源。有人知道这到底是什么意思吗?
【问题讨论】:
标签: php smtp openssl ssl swiftmailer