How to set SMTP config to use localhost?

If it’s on the same docker host but within a different docker container you need to specify the host IP.

127.0.0.1 won’t work as that’s the loopback address. Each container sees 127.0.0.1 as itself.