A simple local SMTP server [closed]

2019-01-13 15:13发布

I want to test a Java code for sending email. I don't want to use any commercial mail client or connect to any external mail providers (like Gmail or Yahoo). I would like to know if there is any software which allows a user to configure dummy email addresses and server (locally) which can be used in my software to send and receive mails. I just want to test the functionality of the Java code.

10条回答
可以哭但决不认输i
2楼-- · 2019-01-13 15:34

amazing docker
https://hub.docker.com/r/mailhog/mailhog/
(gitHub - https://github.com/mailhog/MailHog)
This docker has two ports:
One port for sending SMTP e-mails (smtp://0.0.0.0:1025/)
A second port to the e-mail display on the web (http://0.0.0.0:8025/)

run docker:
docker pull mailhog/mailhog
docker run --name=mailhog -d -p 1025:1025 -p 8025:8025 mailhog/mailhog

查看更多
We Are One
3楼-- · 2019-01-13 15:36

on Leopard you can start a Local SMTP Server (Postfix) on OS-X Leopard

sudo vi /System/Library/LaunchDaemons/org.postfix.master.plist

before the closing tag at the end:

<key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/>

then start the thing with

sudo postfix start

now you check wheter the service is running with:

telnet localhost 25
查看更多
劫难
4楼-- · 2019-01-13 15:39

I've used Mailtrap a few times, and I can recommend it.

查看更多
乱世女痞
5楼-- · 2019-01-13 15:44

You can use Wiser in the SubEthaSMTP library, Wiser's purpose is exactly what you want, unit testing.

查看更多
登录 后发表回答