Swiftmailer 本地主机

huangapple go评论158阅读模式
英文:

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 ?

huangapple
  • 本文由 发表于 2020年1月7日 00:42:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/59615859.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定