I was working on a web application recently, and one of the requirements was the ability to send email to customers from a feedback form. So the customer fills out the web page form, hits the submit button, and they receive a nice 'thank you' email. It was a little more complicated than that, in that there were a variety of email templates to use depending on selections made by the customer. We really wanted to be able to see the actual emails in several email clients, in particular, in Outlook.
I looked around the internet for a simple email server, something that would just work and wouldn't take half of the IT department to configure and maintain.
My requirements were simple:
can work locally without network access
little or no configuration
There were a couple of apps that I found that were close, but they didn't support POP3, so there wasn't a way to connect Outlook.
It turns out that SMTP and POP3 are surprisingly easy protocols to implement, so I wrote "localmail". It meets all my requirements. This is a tiny, super simple java app that runs both an SMTP server and a POP3 server. It also has web mail. By "tiny" I mean really small -- the entire download including source and documentation is only 27k.
Here is the feature list:
1. It's super simple. Just 'java -jar localmail.jar' and it's running. No
configuration, no extra stuff to install, no ISP mail accounts. The default ports are probably fine, so it will run right out of the box.
2. POP3 support. I suppose it's just POP support since all the nice features
of POP3 really aren't needed for this purpose, but it is more than sufficient
for testing your emails. This means you can connect any email client that
supports POP3, and almost all of them do, including Outlook.
3. Doesn't need a network connection. This is nice for those situations like
when you're traveling and don't have internet. It's all contained on your
local machine so you can send and receive email all you want.
4. Webmail is built in. Just point your browser at localmail, and see your
messages in a browser. Sweet!
5. Does not require a JDK, any JRE 1.7 or later should work fine.
6. There is no persistent mail storage. Once you stop localmail, the messages
are lost, so no cluttering up your hard drive with a bunch of test messages.
7. All smtp and pop3 command interaction can be shown in the localmail output.
This makes it easy to see exactly what your mail client is sending and receiving.
8. localmail will accept email from any "From" address and to any "To" address.
However, there is only one mail box, so when you connect a POP3 client, you'll
get all messages sent to localmail regardless of the addresses.
9. No SSL support. This helps keep localmail super simple.
10. No username/password is necessary. Some email clients will whine, so fill
one in. It doesn't matter what they are, localmail will accept them.
11. While the intent is for localmail to run on the same machine as the
development platform, it is certainly possible to run it on a dedicated
machine elsewhere on the network. In this way, several users can use the same
instance of localmail.
The download includes the runnable jar file, the source code, and a little bit of documentation.
Update 27 Nov 2013: I repurposed an old project on SourceForge for this, so the links point there now.