Dummy SMTP Server Send Email Java

Dummy SMTP Server Send Email Java

Sending email from java is an easy task. In development environment usually company blocks use of SMTP server from development environment. You could use only authorized box to send and receive an email. In this situation unit testing of our email program is difficult task. Dummy SMTP server is very suitable in this scenario that can be use to test email functionality without using any authorized SMTP server. I did test on many dummy SMTP server and found FAKESMTP is right choice to use an dummy SMTP server and it’s easy to use.

  • Download FAKESMTP server from here
  • Once download is completed unzip the file. You will see fakeSMTP-xxx.jar (In my case it is fakeSMTP-1.13.jar) got extracted. Because it’s an executable jar file, so that you can double click to open it. You will see as below, click start to start the server.

Dummy SMTP Server Send Email Java
Dummy SMTP Server Send Email Java

  • As you see FAKESMTP server started on port number 25 on localhost (You can also change the port if you want). Use below java program to send and test email:

 SendEmailJavaFakeSMTP.java

  • Output:

Dummy SMTP Server Send Email JavaDummy SMTP Server Send Email Java

download Download fakeSMTP-latest if you don’t find it.

Leave a Reply

Your email address will not be published. Required fields are marked *