I'm working on a project that is email-intensive and I appreciate that the emails land in mailhog on DDEV, but I want to see them in gmail, Outlook, etc. How can I get them to where I want to look at them? (I use ddev launch -m
to launch the mailhog browser in ddev; docs are at https://ddev.readthedocs.io/en/latest/users/developer-tools/#email-capture-and-review
Edit: This answer is obsolete, as DDEV no longer uses MailHog in v1.22.4+
This isn't too hard to do, it's just that Mailhog's debug/error output isn't captured or presented by ddev, so it requires a bit of effort to get it working.
Step by step:
#!/bin/bash
## Description: capture debug from mailhog
## Usage: mailhog-debug
## Example: "ddev mailhog-debug"
set -eu -o pipefail
echo "mailhog on project d8composer"
sudo rm -f /etc/supervisor/conf.d/mailhog.conf # Remove mailhog from supervisor conf
kill -1 1 # Tell supervisord to reload
killall mailhog || true
mailhog
ddev launch -m
to launch the Mailhog interface).ddev mailhog-debug
- it will keep going until you I'm using a recent version of DDEV (1.21.6
).
I found I didn't need the custom command above. Mailhog recieved my mail fine, so I just clicked release and entered the details of my SMTP server and released the mail. It arrived in my inbox in seconds.
Alternatively, because my project uses Drupal 10, I installed the symfony_mailer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With