Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to develop and test an app that sends emails (without filling someone's mailbox with test data)? [closed]

People also ask

How do you send a test email on Gmail?

Navigate to Gmail Settings > General > Dynamic email and click Developer settings. This opens a dialog where you can whitelist an email address that can send you dynamic emails for testing purposes.


I faced the same problem a few weeks ago and wrote this: http://smtp4dev.codeplex.com

Windows 7/Vista/XP/2003/2010 compatible dummy SMTP server. Sits in the system tray and does not deliver the received messages. The received messages can be quickly viewed, saved and the source/structure inspected. Useful for testing/debugging software that generates email.


A few ago I came across the following solution for the .NET platform.

<system.net>
  <mailSettings>
    <smtp deliveryMethod="SpecifiedPickupDirectory">
      <specifiedPickupDirectory pickupDirectoryLocation="C:\TestMailMessages\" />
    </smtp>
  </mailSettings>
</system.net>

Simply place the above code in your App.config or Web.config. When you send a message now it will be stored as a file in the directory you provided as "pickupDirectoryLocation". Works like a charm.


There is now a web based version of Papercut.

Also the app based version works fine for me.


Dumbster might be what you want then. It's an open source fake SMTP server written in Java. It takes the place of a real SMTP server, so you can test your app in a realistic setting, without having any code stubbed out. You can make sure the right messages are sent to the SMTP server without actually delivering messages.


This is similar to the smtp4dev except implemented in java so it works for non-windows developers.

http://www.aboutmyip.com/AboutMyXApp/DevNullSmtp.jsp


There is also Papercut and Neptune, too bad none of these can be run in a portable way.