Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

help file

Imports System.Net.Mail
Public Class Form1
   Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      ' Set the caption bar text of the form.   
      Me.Text = "tutorialspoint.com"
   End Sub

   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      Try
         Dim Smtp_Server As New SmtpClient
         Dim e_mail As New MailMessage()
         Smtp_Server.UseDefaultCredentials = False
         Smtp_Server.Credentials = New Net.NetworkCredential("[email protected]", "password")
         Smtp_Server.Port = 587
         Smtp_Server.EnableSsl = True
         Smtp_Server.Host = "smtp.gmail.com"

         e_mail = New MailMessage()
         e_mail.From = New MailAddress(txtFrom.Text)
         e_mail.To.Add(txtTo.Text)
         e_mail.Subject = "Email Sending"
         e_mail.IsBodyHtml = False
         e_mail.Body = txtMessage.Text
         Smtp_Server.Send(e_mail)
         MsgBox("Mail Sent")

      Catch error_t As Exception
         MsgBox(error_t.ToString)
      End Try
   End Sub

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.