php - 无法使用 gmail SMTP 从 PHP 发送电子邮件

标签 php ssl gmail

我尝试使用 gmail SMTP 从 wordpress 发送消息。

服务器设置为 smtp.gmail.com,端口设置为 465

我收到这条消息:

SMTP -> ERROR: Failed to connect to server: Unable to find the

socket transport "ssl" - did you forget to enable it when you configured PHP? (34225384)

我在 centOS 上

我是否应该重新编译 PHP 并在某处启用某些东西?

最佳答案

听起来像openssl尚未安装/启用。检查 phpinfo() 是否提及 openssl,如果不存在,您可能需要使用 openssl 支持重新编译或在 php.ini 中启用扩展。

关于php - 无法使用 gmail SMTP 从 PHP 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7636921/

相关文章:

android - 使用 OAuth 和 Android 的 AccountManager 提供的 Google 帐户 token 通过 IMAP 连接到 GMAIL

php - 为 Gmail 创建跟踪像素

php - 只需插入 1 次即可在同一列中的 MySQL 数组中插入不同的值

php - Symfony 对字符串调用成员函数 format()

android - TCPDUMP - 捕获 Android HTTPS 数据

ssl - Kubernetes 客户端证书(RKE 托管)

javascript - PHP fatal error : Call to undefined function esc_url()

PHP MYSQL SELECT 查询参数包含与号(&)

ssl - 适用于 Windows 的 OpenSSL RSA。后门?

c# - 如何使用 MailKit 发送电子邮件?