Utiliser Mailjet avec C Sharp.

Description

 
 
using System.Net;
using System.Net.Mail;
 
[STAThread]
static void Main(string [] args)
{
	String APIKey = "your Mailjet API Key";
	String SecretKey = "your Mailjet Secret Key";
	String From = "you@example.com";
	String To = "recipient@example.com";
 
	MailMessage msg = new MailMessage ();
 
	msg.From = new MailAddress (From);
 
	msg.To.Add (new MailAddress (To));
 
	msg.Subject = "Your mail from Mailjet";
	msg.Body = "Your mail from Mailjet, sent by C#.";
 
	SmtpClient client = new SmtpClient ("in.mailjet.com", 587);
	client.DeliveryMethod = SmtpDeliveryMethod.Network;
	client.EnableSsl = true;
	client.UseDefaultCredentials = false;
	client.Credentials = new NetworkCredential (APIKey, SecretKey);
 
	client.Send (msg);
}