ilham150
Messages postés9Date d'inscriptiondimanche 19 avril 2009StatutMembreDernière intervention22 avril 2010
-
29 mars 2010 à 17:12
bizu -
27 nov. 2013 à 14:05
bonjour tt le monde je veux savoir comment je peux envoyer un email à plusieurs destinaires en visual basic et merci d'avance
Dim message As New MailMessage("from@gmail.com", "to@gmail.com", "TEST Subject", "TEST Message Text")
Dim emailClient As New SmtpClient("smtp.gmail.com", 25)
'''Dim emailClient As New SmtpClient("smtp.gmail.com", 587)
'''Dim emailClient As New SmtpClient("smtp.gmail.com", 465)
Try
emailClient.Send(message)
MsgBox("ouiii")
Catch ex As Exception
MsgBox("noooon")
End Try
aprè une long lecture ds kelk forum , j croiè ke le blèm est a cause du SSL !!
alors j ai remplacé mon code par ça :
Dim mail As New MailMessage()
mail.From = New MailAddress("from@gmail.com")
mail.To.Add("to@gmail.com")
mail.Subject = "This is an email"
mail.Body = "this is the body content of the email."
Dim smtp As New SmtpClient("smtp.gmail.com", 25)
smtp.Credentials = New NetworkCredential("ensem.weekend@gmail.com", "arsi.123")
smtp.EnableSsl = true
'''smtp.EnableSsl = False
Try
smtp.Send(mail)
MsgBox(" oui ")
Catch ex As Exception
MsgBox(" non ")
End Try