Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
524 views
in Technique[技术] by (71.8m points)

swiftmailer - Unable to send emails in Laravel using Swift Mailer - proc_open() function disabled by the provider

My web host disabled proc_open function in php and I can't send emails anymore.

I get this error log:

> proc_open() has been disabled for security reasons

I use laravel default Swiftmailer. What can I do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

proc_open should only be required when Swiftmailer is using an external executable, like sendmail. You should still be able to use a different transport like SMTP, Mailgun, or one of the other drivers described in the docs.

As a test, try using the SMTP driver, and just entering your own SMTP mail details - whatever you use to send mail from your mail client. Try the following in your .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)

This is probably not suitable for a permanent solution but will let you test that you can send mail without proc_open. I use the free tier of Mailgun and can recommend it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...