Zend Mail Gmail SMTP [英] Zend Mail Gmail SMTP

查看:137
本文介绍了Zend Mail Gmail SMTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过gmail从Zend_Mail模块发送一些电子邮件。
这是我的代码:

  $ 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]:此流不支持/library/Zend/Mail/Protocol/Smtp.php第206行的SSL / crypto
无法通过TLS连接



我试着告诉我的托管服务提供商在phi.ini中启用openssl.dll



但他们说不是必要的,因为服务器在Linux中,并且不需要启用openssl.dll来使用TLS或SSL。



我的托管服务提供商是错误的还是我我的代码中出错了。



提前感谢



Fabian

解决方案

openssl.dll是windows的openssl扩展名。



在Linux上,您需要通过OpenSSL支持来编译PHP。
http://www.php.net/manual/en/openssl .installation.php



您需要OpenSSL for PHP套接字和流函数才能使用TLS。 Zend使用这些功能,因此需要相同的功能。


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);

Error:

Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in /library/Zend/Mail/Protocol/Smtp.php on line 206 Unable to connect via TLS

I tried telling my hosting provider to enable the openssl.dll in phi.ini

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.

Thanks in advance

Fabian

解决方案

openssl.dll is the windows openssl extension.

On Linux you need to compile PHP with OpenSSL support. http://www.php.net/manual/en/openssl.installation.php

You need OpenSSL for PHP sockets and stream functions to use TLS. Zend uses these functions and thus require the same.

这篇关于Zend Mail Gmail SMTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆