daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest May 31st, 2017 553 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Protected Sub Email_Click(sender As Object, e As EventArgs) Handles Email.Click
  2.         Using mail As New MailMessage("recipient@gmail.com", "youremail@gmail.com")
  3.  
  4.             mail.Subject = "this is a test"
  5.             mail.Body = "This is confirmation for the recent purchase in CIS 451. Your total cost was " & lblTotal.Text & ". Thank you for shopping with us!"
  6.             Dim smtp As New SmtpClient()
  7.             smtp.Host = "smtp.gmail.com"
  8.             smtp.EnableSsl = True
  9.  
  10.             Dim NetworkCred As New NetworkCredential("youremail@gmail.com", "password")
  11.             smtp.UseDefaultCredentials = True
  12.             smtp.Credentials = NetworkCred
  13.             smtp.Port = 587
  14.             Try
  15.                 smtp.Send(mail)
  16.                 Response.Write("Your Email has been sent sucessfully - Thank You")
  17.                 Response.Redirect("Summary.aspx")
  18.             Catch exc As Exception
  19.                 Response.Write("Send failure: " & exc.ToString())
  20.             End Try
  21.         End Using
  22.     End Sub
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