laravel - 无法使用 Swift Mailer 在 Laravel 中发送电子邮件 - 提供商禁用了 proc_open() 功能

标签 laravel swiftmailer

我的虚拟主机禁用了 php 中的 proc_open 功能,我无法再发送电子邮件了。

我收到此错误日志:

> proc_open() has been disabled for security reasons

我使用 laravel 默认的 Swiftmailer。 我能做什么?

最佳答案

proc_open 只有在 Swiftmailer 使用外部可执行文件(如 sendmail)时才需要。您应该仍然可以使用不同的传输方式,例如 SMTP、Mailgun 或 one of the other drivers在文档中描述。

作为测试,尝试使用 SMTP 驱动程序,并输入您自己的 SMTP 邮件详细信息 - 无论您使用什么从邮件客户端发送邮件。在您的 .env 中尝试以下操作:

MAIL_DRIVER=smtp
MAIL_HOST=your.smtp.host // (copy from your mail client)
MAIL_PORT=your.smtp.port // (copy from your mail client)
MAIL_USERNAME=your.smtp.username // (copy from your mail client)
MAIL_PASSWORD=your.smtp.password // (copy from your mail client)

这可能不适合永久解决方案,但可以让您测试是否可以在没有 proc_open 的情况下发送邮件。我使用 Mailgun 的免费层,可以推荐它。

关于laravel - 无法使用 Swift Mailer 在 Laravel 中发送电子邮件 - 提供商禁用了 proc_open() 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45854659/

相关文章:

javascript - sql count函数返回对象作为laravel中的输出

php - Laravel 5 PDOException 找不到驱动程序

HTML 与纯文本作为电子邮件中的正文

php - 如何在其他 Controller 中假脱机发送电子邮件(在任务中)并发送普通电子邮件?

Laravel:电子邮件未发送

php - Laravel 5 身份验证中间件总是重定向到 root 或登录

php - Laravel 路线不工作。没有拿到id

php - Laravel SQLSTATE[42000] : Syntax error or access violation

swiftmailer - PHP Swift 邮件和 Outlook 365

php - Swiftmailer 在 'cc' 为空时提示