I have some code in my asp.net which sends an email:
public void SendEmail(string message)
{
var body = message;
var email = new MailMessage(Configurati
http://ssfd.codeplex.com/
You can use SMTP4Dev
http://smtp4dev.codeplex.com/
Just install it (it's a little program that runs in your task bar). No configuration is required from your development program end...
By default, I think it will just work with your code unmodified as it listens on your local host.
You'll get a nice taskbar popup notification when you send emails... just click on the notification to look at the actual contents of the email!
There is a very simple way to test the resulting email in approvaltests. You need to separate the method into 2 methods, one that creates the email, one that sends the email. Then you can call.
EmailApprovals.Verify(mail)
There's a video showing the process here: http://www.youtube.com/watch?v=Sf16dPq2n3w
to setup an automated test you'll want to have a test email address on a server you can query (since topic is asp.net, we'll assume exchange server), then query the mailbox for the email you're looking for using:
opt 1: exchange sdk
opt 2: through web requests (if the exchange server's http connector is enabled
opt 3: write your own simple pop3 client/cli/api
ref for opt 3: http://www.codeproject.com/KB/IP/popapp.aspx
Send an email to yourself and see if you received it?
If you don't know how to do that you probably want to go back to basics.
Just create a folder called "maildrop" on your c:/ drive and use the following in your Web.config file:
<mailSettings>
<smtp deliveryMethod='SpecifiedPickupDirectory'>
<specifiedPickupDirectory pickupDirectoryLocation="c:\maildrop" />
</smtp>
</mailSettings>
More information:
http://weblogs.asp.net/gunnarpeipman/archive/2010/05/27/asp-net-using-pickup-directory-for-outgoing-e-mails.aspx