public static void Main (string[] args)
var message = new MimeMessage ();
message.From.Add (new MailboxAddress ("L.C.", "laurent.cocea@sympatico.ca"));
message.To.Add (new MailboxAddress ("L.C.", "lcocea@gmail.com"));
message.Subject = "LevineEmailClient -- Test MailKit";
message.Body = new TextPart ("plain") {
Text = @"Testing MailKit from dotnetfiddle.net
>myaccount.google.com/apppassword
//https://github.com/jstedfast/MailKit
// replace single ' with double '
public static void Main (string[] args)
var message = new MimeMessage ();
message.From.Add (new MailboxAddress ('L.C.', 'laurent.cocea@sympatico.ca'));
message.To.Add (new MailboxAddress ('L.C.', 'lcocea@gmail.com'));
message.Subject = 'LevineEmailClient - Test MailKit #1';
message.Body = new TextPart ('plain') {
Text = @'Testing MailKit from dotnetfiddle.net
>myaccount.google.com/apppassword
using (var client = new SmtpClient ()) {
client.Connect ('smtp.gmail.com', 587, false);
// Note: only needed if the SMTP server requires authentication
client.Authenticate ('lcocea@gmail.com', 'lsyb fpko npky hpsx');
client.Disconnect (true);
using (var client = new SmtpClient ()) {
client.Connect ("smtp.gmail.com", 587, false);
client.Authenticate ("lcocea@gmail.com", "lsyb fpko npky hpsx");
client.Disconnect (true);