How to send mail in VB .net using System.Net.Mail (SMTP)

In .net we have special namespace called System.Net.Mail. It contains classes used to send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery.

There are three main classes under this namespace.
MailMessage: This class represents the content of a mail message.
SmtpClient: This helps us to transmit emails to the SMTP host (Server) that we specify
Attachment: We all know what is attachment is, this class helps us to create mail attachments.

There are many methods and properties under these three classes.
If you want to know more about it then Click here.

In below post, I will be explaining you a simple and basic methods which we can use to send mails. Of-course later on if you want you can add some more advanced features to it.

1. We have to import below namespace first.

2. Create an object of SmtpClient class

Related Posts Plugin for WordPress, Blogger...
Powered by Blogger