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

问题描述 投票:0回答:1

我在共享服务器上使用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()))

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

php laravel
1个回答
0
投票

在共享服务器中,多次操作系统的功能不能通过安全问题工作。

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

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

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

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=yourpassword
MAIL_ENCRYPTION=tls

我希望能帮助你。

© www.soinside.com 2019 - 2024. All rights reserved.