Test Send Mail Task Locally

When working with Send Mail task Tool in SSIS I always try to enter the From,To fields as my email ids(abc@gmail.com or bca@yahoo.com) but there will not be any mail trigger from the package. Tried many days with that but no success, in the end used the script task for it.

1

Finally, came across one post on the internet where we can set up a mail server locally where we can send or receive mails. Before explaining how to set up the mail server locally, the reason for the send mail task not triggering the mail is by default the send mail task tool uses the port:25 for sending or receiving  the mail. If we use the gmail or any email’s for this it may not work as the port varies and we have no option of changing the port. (Also came to know that this issue has been reported by the users to Microsoft)

So, to overcome this issue download the smtp4dev tool from the below link

http://smtp4dev.codeplex.com/

Extract the .exe files and double click on it. Application will open and which looks like this

2

As I mentioned earlier now, Send Mail Task by default uses the default port:25. You can see the application Listening on port 25 for messages (Highlighted in the below screenshot)

3

Now Create a new connection in Send Mail Task

4

New connection manager details are given below in the screen shot

5

Send Mail Task Editor details are given below in the screen shot

6

Now by running the package You could see the package completed successfully and the mail message Notification on the bottom of the windows.7

We can save the email inorder to view the content. When saved it will be saved as .eml file use free eml viewer to view the files without issues.

10

This is only for testing purpose. If you have created a package the end result is sent as mail you can easily test with this method before inking in production.

If you are using the script task instead of Send Mail Task and need to use different port other than 25 you can mention it in the script and the same settings can be made in smtp4dev under options-> server

9

Thank you…

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s