a guest May 31st, 2017 553 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- Protected Sub Email_Click(sender As Object, e As EventArgs) Handles Email.Click
- Using mail As New MailMessage("firstname.lastname@example.org", "email@example.com")
- mail.Subject = "this is a test"
- mail.Body = "This is confirmation for the recent purchase in CIS 451. Your total cost was " & lblTotal.Text & ". Thank you for shopping with us!"
- Dim smtp As New SmtpClient()
- smtp.Host = "smtp.gmail.com"
- smtp.EnableSsl = True
- Dim NetworkCred As New NetworkCredential("firstname.lastname@example.org", "password")
- smtp.UseDefaultCredentials = True
- smtp.Credentials = NetworkCred
- smtp.Port = 587
- Response.Write("Your Email has been sent sucessfully - Thank You")
- Catch exc As Exception
- Response.Write("Send failure: " & exc.ToString())
- End Try
- End Using
- End Sub
RAW Paste Data