C# Programmation Réseau: Envoyer un email

Author:



using System;
using System.Net;
using System.Web.Mail;

public class MailTest
{
   public static void Main()
   {
      string from = "from@from.net";
      string to = "to@to.net";
      string subject = "Ceci est un email de C#";
      string body = "Salut .";

      SmtpMail.SmtpServer = "smtp.google.com";
      SmtpMail.Send(from, to, subject, body);
   }
}


           
       

Leave a Reply

Your email address will not be published. Required fields are marked *