1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
message.From = new MailAddress("test@test.com", "test");
message.To.Add(new MailAddress(c.EMAIL, c.NOM));
message.Body = "<html><h1>Big header</h1><p>And some smaller text</p></html>";
message.IsBodyHtml = true;
message.Subject = "ssss";
message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure | DeliveryNotificationOptions.OnSuccess | DeliveryNotificationOptions.Delay;
message.Headers.Add("Disposition-Notification-To", "test@test.com");
smtp.Host = "smtp.orange.tn";//"smtp.orange.tn";
smtp.Port = 25;
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = false;
try
{
smtp.Send(message);
}
catch
{
Console.WriteLine("erreur");
} |
Partager