我正在开发一个Swift_Mailer
用于发送电子邮件的 Symfony 4 应用程序。由于在我的情况下不可能使用 SMTP(不要问为什么......)我必须使用类似sendmail
.
默认情况下,Swift Mailer 的配置在 Symfony 的.env
文件中以 URL 表示法在名为MAILER_URL
. 默认值为“ null://localhost
”,它根本不发送邮件。
我所能找到的值必须是 Gmail 或 SMTP 的示例,如Symfony 文档以及 Composer 生成的示例 .env 中所述。
.env 的默认内容:
# …
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###
# …
Run Code Online (Sandbox Code Playgroud)
我不知道什么,因此我的问题是:
我需要做什么才能sendmail
使用它?
我已经尝试过类似的东西:
MAILER_URL=sendmail://localhost
Run Code Online (Sandbox Code Playgroud)
和
MAILER_URL=sendmail://my-domain.com …
Run Code Online (Sandbox Code Playgroud)