-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
With mhsendmail installed on application container and MailHog on another, I'm unable to set smtp addr using ENV vars. mhsendmail keeps trying to use localhost:1025.
docker-compose.yml:
services:
fpm:
container_name: fpm
image: php:7.2-fpm
environment:
- MH_SENDMAIL_SMTP_ADDR="mailhog:1025"
mailhog:
container_name: mailhog
image: mailhog/mailhog
ports:
- "1025:1025"
- "8025:8025"php.ini:
sendmail_path = /usr/local/bin/mhsendmail
test call run from fpm container:
php -r "\$from = \$to = '[email protected]'; \$x = mail(\$to, 'subject'.time(), 'Hello World', 'From: '. \$from); var_dump(\$x);"result:
error sending mail
dial tcp 127.0.0.1:1025: getsockopt: connection refused
bool(false)running the same test from host works fine.
ro0NL, manuelcanepa, sukhikh18 and vivencio-gogoitlab
Metadata
Metadata
Assignees
Labels
No labels