問題描述
我正在嘗試從 Zend_Mail 模塊通過 gmail 發送一些電子郵件.這是我的代碼:
Hi I'm trying to send some emails via gmail from the Zend_Mail module. This is my code:
$config = array(
'ssl' => 'tls',
'port' => 587,
'auth' => 'login',
'username' => 'webmaster@mydomain.com',
'password' => 'password'
);
$smtpConnection = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
錯誤:
警告:stream_socket_enable_crypto() [streams.crypto]:該流在第 206 行的/library/Zend/Mail/Protocol/Smtp.php 中不支持 SSL/crypto無法通過 TLS 連接
我嘗試告訴我的托管服務提供商在 phi.ini 中啟用 openssl.dll
I tried telling my hosting provider to enable the openssl.dll in phi.ini
但他們說這不是必需的,因為服務器在 Linux 中并且不需要啟用 openssl.dll 來使用 TLS 或 SSL.
But they say that isn't necessary since the server is in Linux and it doesn't need to enable the openssl.dll to work with TLS or SSL.
是我的托管服務提供商錯了還是我在代碼中做錯了.
Is my hosting provider wrong or I'm I doing something wrong in my code.
提前致謝
費邊
推薦答案
openssl.dll 是 windows openssl 擴展.
openssl.dll is the windows openssl extension.
在 Linux 上,您需要使用 OpenSSL 支持編譯 PHP.http://www.php.net/manual/en/openssl.installation.php
On Linux you need to compile PHP with OpenSSL support. http://www.php.net/manual/en/openssl.installation.php
您需要 OpenSSL for PHP 套接字和流函數才能使用 TLS.Zend 使用這些函數,因此需要相同的函數.
You need OpenSSL for PHP sockets and stream functions to use TLS. Zend uses these functions and thus require the same.
這篇關于Zend 郵件 Gmail SMTP的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!