Reputation: 1
I want send mail with Bcc
(Blind carbon copy) with vb.net, but I do not know how to do it.
this is my code:
Function send_MAIL() As Boolean
Dim smtpServer As New SmtpClient()
Dim mail As New MailMessage()
'credenziali per accedere
smtpServer.Credentials = New Net.NetworkCredential("[email protected]", "******")
'porta del tuo HOST di posta
smtpServer.Port = 587
'SMTP del HOST di posta
smtpServer.Host = "smtp.live.com"
'SSL
smtpServer.EnableSsl = True
'Creiamo la mail da spedire
mail = New MailMessage()
'Inserisci l'indirizzo di posta che verrà visualizzato dal destinatario
mail.From = New MailAddress("[email protected]")
'Inserisci l'email del destinatario
mail.To.Add("[email protected]")
mail.To.Add("[email protected]")
'Inserisci l'oggetto
mail.Subject = "OGGETTO"
'testo dell'email
mail.Body = "email prova"
smtpServer.Send(mail)
Return True
End Function
Upvotes: 0
Views: 686
Reputation: 66
I use this:
Dim c As Net.Mail.MailAddress = New Net.Mail.MailAddress(dirección)
myMsg.Bcc.Add(c)
Where "dirección" is a valid email address
Hope this can help you. Bye!
Upvotes: 0
Reputation: 11782
You would simply use the Bcc
member.
mail.Bcc.Add("[email protected]")
Upvotes: 1