英文:
Swiftmailer localhost
问题
Sure, here's the translation:
我想在本地使用Symfony Swiftmailer发送邮件。
我已经在我的.env
文件中添加了这一行:
MAILER_URL=smtp://localhost:25
但是我遇到了以下错误:
刷新邮件队列时发生异常:无法与主机localhost建立连接:stream_socket_client():无法连接到localhost:25(连接被拒绝)
您可以告诉我如何正确发送邮件吗?(我不想使用Gmail)
英文:
I would like to send mail with symfony swiftmailer in localhost.
I have put this line in my .env
file :
MAILER_URL=smtp://localhost:25
And I have the error :
> Exception occurred while flushing email queue: Connection could not be established with host localhost :stream_socket_client(): unable to connect to localhost:25 (Connection refused)
Could you tell what do I have to do to send mail correctly ? (I don't want to use Gmail)
答案1
得分: 4
使用 MAILER_URL=null://localhost
或者您需要安装和配置本地 SMTP 服务器。
英文:
use MAILER_URL=null://localhost
or you need to install and configure a local smtp server
答案2
得分: 0
Ok, I have understood.
Currently, I have to put the username and password in plain text in the .env file.
Is there a possibility to get the username and password at the runtime and store them in the ram instead of storing them in plain text in the .env file?
英文:
Ok, I have understood.
Currently, I have to put the username and password in plain text in the .env file.
Is there a possibility to get the username and password at the runtime and store them in the ram instead of storing them in plain text in the .env file ?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论