Laravel:由于proc_open()导致邮件发送错误

时间:2018-03-05 17:59:51

标签: php laravel

我在共享服务器上使用Laravel Framework来运行电子商务系统,我在邮件发送过程中遇到以下错误。

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

还有其他方式发送邮件吗?

1 个答案:

答案 0 :(得分:0)

在共享服务器中,操作系统的功能很多次都不是安全问题。

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

我希望能帮助你。

相关问题