Zend Mail Gmail SMTP(Zend 邮件 Gmail SMTP)
问题描述
我正在尝试从 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Zend 邮件 Gmail SMTP
基础教程推荐
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
