Advertisement
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("recipient@gmail.com", "youremail@gmail.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("youremail@gmail.com", "password")
- smtp.UseDefaultCredentials = True
- smtp.Credentials = NetworkCred
- smtp.Port = 587
- Try
- smtp.Send(mail)
- Response.Write("Your Email has been sent sucessfully - Thank You")
- Response.Redirect("Summary.aspx")
- Catch exc As Exception
- Response.Write("Send failure: " & exc.ToString())
- End Try
- End Using
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement