Codice:
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Credentials = New Net.NetworkCredential("[email protected], "password")
SmtpServer.Port = 465 'Porta server smtp protetto da ssl
SmtpServer.Host = smtp.gmail.com 'server smtp gmail
SmtpServer.EnableSsl = true
mail = New MailMessage()
mail.From = New MailAddress("[email protected]") 'email mittente
mail.To.Add("[email protected]") 'Destinatario
mail.Subject = "" 'Soggetto del messaggio
mail.Body = "" 'testo del messaggio
SmtpServer.SendMailAsync(mail)
Lista server SMTP
Gmail
Host = smtp.gmail.com ; Port = 465 ; SSL sì
Hotmail
Host = smtp.live.com ; Port = 587 ; SSL sì
Libero
Host = smtp.libero.it ; Port = 465 ; SSL sì
Yahoo
Host = smtp.mail.yahoo.com ; Port = 587 ; SSL sì