问题原文
原帖链接 · Edu · CC BY-SA 4.0
I am using Docker4drupal, a preconfigured set of docker containers.
One of the containers is the mailhog tool.
Docker4drupal is configured to use mailhog as email sender so it captures all mail sent for developing purposes. This is great but I would to allow some emails to pass through.
How can I bypass mailhog for certain emails?
I can think on those approaches:
- Temporary reconfigure docker4drupal to use an smtp server.
- Make mailhog forward emails using an smtp server.
I don't know how to accomplish any of them. How can I do this? I there any other better approach?
已采纳解答
原帖链接 · Moshe Katz · CC BY-SA 4.0
Mailhog's documentation describes how to set it up to release emails to an SMTP server.
In short, you need to set the environment variable MH_OUTGOING_SMTP to contain a JSON object which points to the SMTP server(s) you want to release the message to:
{
"server name": {
"name": "server name",
"host": "...",
"port": "587",
"email": "...",
"username": "...",
"password": "...",
"mechanism": "PLAIN"
}
}
Note that in this configuration you still need to manually "release" the messages in the mailhog interface. I don't think there is a way to tell it something like "auto-release all messages that are being sent to [email omitted]" or similar.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
