No. | Sending Email in Visual Studio 2010 |
---|---|
Give Your Suggestions !!! | |
1. | Part 1 |
2. | Part 2 |
Hello friends, today's tutorial is about adding functionality in Microsoft Visual Studio 2010 basic email form. In the previous part of this tutorial How to Send Email in Microsoft Visual Studio 2010, we have seen a basic email form which just sends email to constant email address which is specified in the coding.
Today we will make this email form a bit flexible and will be able to send the emails to any email id we want. If you have read the previous part of this tutorial, then this article will be nothing for you, you will got it just like a piece of cake instantly.
So, I suppose that you have read the previous tutorial and you have the knowledge of smtp etc so I am not gonna explain it further, so i suggest again to read it first if you have any doubt in configuration part, lets come to this part.
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 = txtSubject.Text Mail.To.Add(txtSend.Text) Mail.From = New MailAddress("email@gmail.com") Mail.Body = rtbMessage.Text Dim smtp As New SmtpClient("smtp.gmail.com") smtp.EnableSsl = True smtp.Credentials = New System.Net.NetworkCredential("email@gmail.com", "password") smtp.Port = "587" smtp.Send(Mail) End Sub End Class
I will recommend you guys to must read these two tutorial on Microsoft Visual Studio as well:
That's all for today guys, if someone having any kind of trouble in any part, ask in comments and help me to help you ..... Take care ..... ALLAH HAFIZ :))
JLCPCB – Prototype 10 PCBs for $2 (For Any Color)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w