-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch to mailpit which supports testing CC and is maintained #31
Comments
Support for the unmaintained status: mailhog/MailHog#442 (comment) where the maintainer of mailhog also mentions mailpit as an alternative. |
If it helps, this is how we used MailPit since last year in Lando for each site: In .lando.yml under services add:
Under proxy add (if you'd like localhost domains, then you can also replace .lndo.site with .localhost):
Then In your site set "mailpit" as SMTP server name, "1025" as SMTP server port. You can view sent mails on http://mail.YOURSITENAME.lndo.site URL. |
Thank you @kaszarobert for the snippet, I was banging my head with this for a couple of hours already. I would still love to see an official recipe for mailpit! |
You also need SMTP setup to start using Mailpit. Drupal Core has a Symfony Mailer component available since version Here's how you can use it with Mailpit:
services:
appserver:
overrides:
environment:
SMTP_ADDRESS: mailpit:1025 I use the
// Symfony Mailer configuration.
// @see: https://www.drupal.org/node/3369935
$config['system.mail']['interface'] = [ 'default' => 'symfony_mailer' ];
// Default SMTP settings.
$smtp_address_parts = explode(':', getenv('SMTP_ADDRESS'));
if (!empty($smtp_address_parts[0]) && !empty($smtp_address_parts[1])) {
$config['system.mail']['mailer_dsn'] = [
'scheme' => 'smtp',
'host' => $smtp_address_parts[0],
'port' => $smtp_address_parts[1],
];
} Here's the full setup as a PR: https://github.com/wunderio/drupal-project/pull/423/files |
Nice thanks @tormi. BTW a little birdie told me that @AaronFeledy might be cooking up a legit mailpit Lando plugin so we can finally mothball this repo. I'm sure he'll post here when there's substantive progress, but wanted to HYPE the possibility :) |
Background:
I was trying to debug an email that was supose to have a CC aswell. Turns out mailhog wont let you view the cc:ed email.
Long story short, use mailpit instead. :/
Docker images
You can view available Docker images on https://hub.docker.com/r/axllent/mailpit.
A basic example of running Mailpit within Docker:
You need to ensure you map the correct ports (default Web UI on 8025 and SMTP on 1025).
Setting Mailpit options
View all runtime options (flags & environment variables). Environment variables can be set using the
-e
flag when starting your docker container, for instance:Docker compose example
The text was updated successfully, but these errors were encountered: