username_leta

Enviar email gmail

Oct 18th, 2016
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  Try
  2.             Dim Mail As New MailMessage
  3.             Mail.Subject = ""
  4.             Mail.To.Add("[email protected]")
  5.             Mail.From = New MailAddress("[email protected]")
  6.             Mail.Body = ""
  7.             Dim SMTP As New SmtpClient("smtp.gmail.com")
  8.             SMTP.EnableSsl = True
  9.             SMTP.Credentials = New System.Net.NetworkCredential("[email protected]", "sua_senha")
  10.             SMTP.Port = "587"
  11.             SMTP.Send(Mail)
  12.         Catch ex As Exception
  13.             MessageBox.Show("Erro : " + ex.Message)
  14.         End Try
Advertisement
Add Comment
Please, Sign In to add comment