No. | Sending Email in Visual Studio 2010 |
---|---|
Give Your Suggestions !!! | |
1. | Part 1 |
2. | Part 2 |
Hello friends, first of all I am really bad in designing stuff. Although I have tried to design the top image for this post but I know its not much cool well try to bear it .... :))
After the Microsoft Visual Studio 2010 - COM Port and Creating a Database in Microsoft Visual Studio 2010 tutorial, here's my next tutorial on VB.net. As the name suggests, this tutorial is about sending an Email through Visual Studio. Again I will use Microsoft Visual Studio 2010 and the language will be Visual Basic for this tutorial.
Usually Sending an Email through software seems quite a difficult task but in actual its really a very easy task. So at the end of this short and quick tutorial, you will be able to develop a software which will send email on your click. I have divided this tutorial into two sections. Today we will just create a simple app which will send emails on just one click and later on we will add few features in it and make it able to send emails through multiple accounts with log in capability. Two parts of this tutorial are as follows:
Imports System.Net.Mail Public Class Form1 Private Sub SendEmail_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendEmail.Click Dim Mail As New MailMessage Mail.Subject = "First Email" Mail.To.Add("Email1") Mail.From = New MailAddress("Email2") Mail.Body = "First Email Through VB.net --- www.TheEngineeringProjects.com" Dim smtp As New SmtpClient("smtp.gmail.com") smtp.EnableSsl = True smtp.Credentials = New System.Net.NetworkCredential("Email2", "Password") smtp.Port = "587" smtp.Send(Mail) End Sub End Class