Torna al Thread
If MyDr.HasRows = True Then
Do While MyDr.Read
destinatari = MyDr.Item("email")
Response.Write(destinatari & "<br>")
'Now, send the email
'Create an instance of the MailMessage class
Dim objMM As New MailMessage()
objMM.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.miodominio.com")
objMM.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
objMM.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 1)
objMM.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1)
objMM.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "info@miodominio.com")
objMM.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "miapassword")
'Set the properties
objMM.To = ""
objMM.Bcc = destinatari
objMM.From = "Mittente < info@miodominio.com >"
'Send the email in HTML format
objMM.BodyFormat = MailFormat.Html
'Set the subject
objMM.Subject = oggetto
'Set the body - use VbCrLf to insert a carriage return
objMM.Body = messaggio
SmtpMail.Send(objMM)
Loop
End If