With email
.From ===> tout est en readOnly ? comment faire ?
.To.Add("titi@toto.com")
.To.Add("tata@toto.com")
.Subject = "Mon sujet"
.Body = mailBody
.Priority = MailPriority.High
end with
Dim mailServerName As String = "IpServer"
Dim mailClient As New SmtpClient(mailServerName)
mailClient.Send(email)
Comment procéder pour pouvoir définir un "From" car toute les propriétés
sont en ReadOnly ?
With email .From ===> tout est en readOnly ? comment faire ? .To.Add("") .To.Add("") .Subject = "Mon sujet" .Body = mailBody .Priority = MailPriority.High end with
Dim mailServerName As String = "IpServer" Dim mailClient As New SmtpClient(mailServerName) mailClient.Send(email)
Comment procéder pour pouvoir définir un "From" car toute les propriétés sont en ReadOnly ?
merci de l'aide.
J'ai finalement trouvé :
Dim a As New MailAddress(monmail@mail.com, "monmail")
"Vincent Dartois" <vdartois@francelot.com> a écrit dans le message de news:
egsPSypQGHA.5152@TK2MSFTNGP10.phx.gbl...
Bonjour,
Suite à une migration d'application de Vs2003 à 2005, je corrige un
avertissement sur le mail.
Je suis en Vb.
Je viens de changer System.web.mail en System.Net.mail
Voici que je bloque sur le "From"
Avant je procéder ainsi :
== VS2003 = > Dim email As New MailMessage
Dim mailBody As String
mailBody = "mon body"
With email
.From = "toto@toto.com"
.To = "titi@toto.com;tata@toto.com;"
.Subject = "Mon sujet"
.Body = mailBody
.Priority = MailPriority.High
End With
With email
.From ===> tout est en readOnly ? comment faire ?
.To.Add("titi@toto.com")
.To.Add("tata@toto.com")
.Subject = "Mon sujet"
.Body = mailBody
.Priority = MailPriority.High
end with
Dim mailServerName As String = "IpServer"
Dim mailClient As New SmtpClient(mailServerName)
mailClient.Send(email)
Comment procéder pour pouvoir définir un "From" car toute les propriétés
sont en ReadOnly ?
With email .From ===> tout est en readOnly ? comment faire ? .To.Add("") .To.Add("") .Subject = "Mon sujet" .Body = mailBody .Priority = MailPriority.High end with
Dim mailServerName As String = "IpServer" Dim mailClient As New SmtpClient(mailServerName) mailClient.Send(email)
Comment procéder pour pouvoir définir un "From" car toute les propriétés sont en ReadOnly ?