Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Easily Send E-mail in VB.net

0.00/5 (No votes)
12 Sep 2008 1  
This is an easiest program that allows you to send e-mails by only defining SMTP Server name.

Introduction

This is an easiest program to send an e-mail using vb.net

Background

This program requires to import System namespace and creating an object of system,net.mail.Smtpclient and passing SMTP Server name as an argument.

First it is required to define SMTP Mail server name.

G-Emailer

Using the code

You have to only define SMTP mail server name.

Now passing this server name as an argument to smtp client , and create and object which accepts to,from,subject and body of e-mail message.

            
Dim EmailServer As New System.Net.Mail.SmtpClient("Mail server name")    

Dim myMessage As New System.Net.Mail.MailMessage("Sender's address", "Receiver's address", "Subject", "Main msg")    

snap2.jpg

Now pass this myMessage object as argument to Emailserver.send(myMessage).

History

This is the easiest approach that I found for sending e-mails in VB.net 

If you like this article then vote me.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here