Wednesday, August 7, 2019

How to set up FakeSMTP Server for your development and testing environment

Hi,

In this post we are going to see how to install a fake SMTP server for our development/testing environment...

Many of us as developers would always encounter a situation during development/testing, the mailing feature of the application. We have different ways of setting up SMTP Server locally but those are very time consuming or the server package would require a lot of configuration to be done.

But with FakeSMTP it will be like a cake walk to have SMTP server installed locally with minimal or no configurations.

For details you can refer the following site to have more details about FakeSMTP

Official Site of Fake SMTP

Let us go straight into the business of installing FakeSMTP server in our development/testing environment

1. Installation
1. Please download FakeSMTP server package using the link given below and hold it in your preferred location.

Direct Link : Download FakeSMTP Server

2. Extract the package

3. Open an terminal and navigate to the folder where you have extracted FakeSMTP server package

4. At the prompt, fire the command as given below...
> java -jar fakeSMTP-2.0.jar
This article was written at the time when FakeSMTP was at version 2.0, please change the name of the jar file accordingly in case if you have different version of FakeSMTP

2. Usages

Graphical User Interface Option
If you want the Graphical User Interface along with SMTP server, then fire the command below
> java -jar fakeSMTP-2.0.jar

the result of the command execution would result something like the image given below...



the GUI has three important parts to be talked about....

1. The PORT
2. Control to start the server
3. Place holder to save  the mail messages

The port and place holder items are configurable and we can change that anytime according to our needs.

The default port is "25", in order to have the server run make sure you do not have any service running at port 25, if you have then change the port value of FakeSMTP to any other value other than "25" eg "1024"

Background Task Option

FakeSMTP provides another option to have the server run as back ground task, to achieve that run the following command at the prompt..
> java -jar fakeSMTP-2.0.jar -b -p 2525 -a 127.0.0.1
Let us discuss the command line arguments of the above command...

'-b' switch : Indicates that the server should run as background task

'-p' switch : Holds the port value of the server

'-a' switch : Holds the IP Address, in this case the IP address is the loopback address.

You can also specify the place holder to save the mail messages with the following command.
> java -jar fakeSMTP-2.0.jar -b -o <NAME-OF-THE-FOLDER> -p 2525 -a 127.0.0.1
the switch '-o' stands for Output Folder 

If you do not want to save the mail messages in a folder you could also do that via a switch as given below...
> java -jar fakeSMTP-2.0.jar -b -m -p 2525 -a 127.0.0.1

the --help option would list down all the options that server contains...
> java -jar fakeSMTP-2.0.jar --help

Well this concludes the installation of FakeSMTP Server

Hope you had good time reading it.

Thanks.

No comments:

Post a Comment

How to change the root password in linux when it is forgotten/to change

This blog is all about changing the root password of the Linux system when it is forgotten or to reset the password...   Let's get it ...