Guest User

Untitled

a guest
Nov 21st, 2015
119
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub emailTeacher()
  2. Try
  3. Dim Server As New SmtpClient
  4. Dim email As New MailMessage()
  5. Server.UseDefaultCredentials = False
  6. Server.Port = 465
  7. Server.EnableSsl = True
  8. Server.Host = "smpt.gmail.com"
  9. email = New MailMessage()
  10. email.From = New MailAddress(fromEmail)
  11. email.To.Add(emailAddress)
  12. email.Subject = subjectEmail
  13. email.IsBodyHtml = False
  14. email.Body = emailBody
  15. Server.Send(email)
  16. MsgBox("Mail Sent")
  17. Catch error_t As Exception
  18. MsgBox(error_t.ToString)
  19. End Try
RAW Paste Data