In this case I need to test emails from a Timer job.
During the development phase it is not always possible to have a SMTP sever available to test the functionality and in those scenarios Papercut is the best utility available for our help. Papercut is a simplified SMTP server designed to only receive messages and serve the purposes of a light-weight SMTP.
You can use Papercut in .Net development or SharePoint development. You just need to download and install the Papercut on your SharePoint server.
The following are some points to consider when using Papercut with SharePoint:
- Papercut is only to receive emails.
- For ASP.Net applications provide host=”127.0.0.1″ port=”25″ in the web.config file under the mailsettings section.
- For SharePoint, if you have a single server Farm then you don't need to worry, just install Papercut and set the "Outbound SMTP Server" to localhost or 127.0.0.1 in "Configure outgoing e-mail settings" under central admin, System Settings.
- You can now test by creating a simple alert on any list.
- If you have a muti-server Farm and testing email from a timer job then we need to find on which server the timer service is running and on that sever you need to install Papercut also. Provide this server IP in "Outbound SMTP Server" in "Configure outgoing e-mail settings" under Central Admin, System Settings.
- If the timer service is running on more than one server then ensure port 25 is open between those servers to get emails from the timer job.
- I hope this will help.
Note: complete contribution, development and license rights are with the team who have developed this and as in the
http://papercut.codeplex.com/license. This article is just to make readers aware of the existence of this tool.