1 2 3 4 5 6 7 8 9 10 11 12 13 14
| public static void sendemail(string emailadress, string htmlfilepath)
{
var mail = new MailMessage("emailfrom", emailadress, "test", "rien");
mail.Priority = MailPriority.High;
mail.IsBodyHtml = true;
mail.Body = ""; // c'est ici que je ne sais pas comment faire
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.Port = 587;
smtp.EnableSsl = true;
NetworkCredential cred = new NetworkCredential(
"username",
"password");
smtp.Credentials = cred;
smtp.Send(mail); |
Partager