【问题标题】:Laravel: Mail send error due to proc_open()Laravel:由于proc_open()导致邮件发送错误
【发布时间】:2018-03-05 17:59:50
【问题描述】:

我在共享服务器上使用 Laravel 框架来运行电子商务系统,我在发送邮件时收到以下错误。

(1/1) ErrorException

proc_open() has been disabled for security reasons
in StreamBuffer.php (line 295)
at HandleExceptions->handleError(2, 'proc_open() has been disabled for security reasons', '/home/--hidden--/public_html/shop/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php', 295, array('command' => '/usr/sbin/sendmail -bs', 'descriptorSpec' => array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')), 'pipes' => array()))

有没有其他方式发送邮件?

【问题讨论】:

标签: php laravel


【解决方案1】:

在共享服务器中,操纵系统的功能多次无法通过安全问题进行操作。

Laravel 允许您使用许多驱动程序,例如 SMTP、Mailgun、Sparkpost、SES 等。

您可以使用 Mailgun,它是发送交易电子邮件的好工具。

但发送电子邮件更简单的方法是使用 Gmail 等 SMTP 帐户,只需配置您的 .env 文件:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=youremail@gmail.com
MAIL_PASSWORD=yourpassword
MAIL_ENCRYPTION=tls

希望对你有帮助。

【讨论】:

  • 我可以关闭 tls 安全性吗?我没有 SSL。
猜你喜欢
  • 2018-02-26
  • 2019-02-28
  • 2016-01-12
  • 1970-01-01
  • 2014-04-03
  • 2019-05-21
  • 2022-01-18
  • 2019-11-22
  • 1970-01-01
相关资源
最近更新 更多