Just another plug for a very helpful tool that I’ve been using for testing SMTP code locally. Smtp4dev simulates an SMTP server on your local machine, allowing you to send email via a local SMTP connection in your code when you do not have a SMTP server setup. You can even inspect the messages to ensure that they are exactly as intended, with the subject, body, etc. Very simple, but useful tool that I find myself using quite often. http://smtp4dev.codeplex.com/ (see below for a basic example of sending a message via smtp locally)
public static void SendEmail(string aFrom, string aTo, string aSubject, string aBody)
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress(aFrom);
//set the content
mail.Subject = aSubject;
mail.Body = aBody;
//send the message
SmtpClient smtp = new SmtpClient("localhost");
smtp.UseDefaultCredentials = true;
I want to take a minute to give a quick shout out to UptimeRobot.
UptimeRobot is a completely free site that allows you to monitor up to 50 websites for downtime related issues. Ã‚Â It polls your sites every 5 minutes, and alerts you via email if anything seems wrong. It’s extremely useful, and did I mention that it’s FREE!?Ã‚Â
The interface is simple to use. Simply enter the URL you want to monitor, and you’re off! You can check back anytime to get statistics on your site’s uptime, and to see when the last “downtime event”Ã‚Â occurred. You can also subscribe to your monitors via RSS if that’s something you’re interested in doing.Ã‚Â UptimeRobot also includes monitors for pings, keyword checking, and ports, although I am only familiar with the HTTP uptime monitor.
This tool has proven itself useful a couple times already, sending me emails when sites are down, and then sending me emails again when they are subsequently back up.
Overall, a great site, that’s free, and is extremely useful for monitoring client’s websites for down time, or gathering uptime statistics.