The program is written in Visual Studio 2010. It is applicable only for gmail accounts.
Code Snippet
Dim
smtpServer As New
SmtpClient()
Dim
mail As New MailMessage
smtpServer.Credentials = New Net.NetworkCredential(TextBox1.Text
& "@gmail.com", TextBox2.Text)
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
smtpServer.EnableSsl = True
mail.From = New
MailAddress(TextBox1.Text & "@gmail.com")
If
RadioButton1.Checked = True Then
mail.To.Add("+63" & TextBox3.Text & "@m3m.in")
ElseIf
RadioButton2.Checked = True Then
mail.To.Add(TextBox3.Text)
End If
mail.Subject = TextBox4.Text
mail.Body = TextBox5.Text()
smtpServer.Send(mail)
MsgBox("Mail
is sent", MsgBoxStyle.OkOnly, "Report")
TextBox2 - existing gmail password
Programming Language: Visual Basic.Net
Programming IDE: Visual Studio 2010