Learning While Aging

Sending email with Visual Studio 2008 in Windows 7 by using Free SMTP Server

You may already know that Microsoft dropped SMTP in client OS since Windows Vista, so apparently Windows 7 will not have SMTP either. If you need a SMTP on your local machine to test and debug your mail function as I do, you can install a free third-party SMTP server called Free SMTP Server. The installation is very straight forward and you don’t need to do any customization. In your application, just use “localhost” as the SMTP host and you are done. Here is an example of using Free SMTP Sever to send a test email in Visual Studio 2008 web application.

The SMTP settings can be stored in web.config:

    <smtp deliveryMethod="Network">
      <network host="localhost"/>

A sample email snippet:

Dim mm As New MailMessage()
mm.Subject = "Test email from www.TechProsZone.net"
mm.Body = "This is a test email from http://www.TechProsZone.net"
mm.IsBodyHtml = True
Dim smtp As New SmtpClient()

When the above code snippet is executing, you will see an active connection in Free SMTP Server shown as follows:


Note: you will need to keep Free SMTP Server running in order to use it to send email in your web application.

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
Close Bitnami banner