kshadow22

Email Sender (Gmail) Visual Basic 2008

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