Creating an EML file (email) using the .NET library. EML file is written to a "pickup directory," using the built-in functionality of the SmtpClient class. Note: the pickup directory must exist.
using System.Net.Mail;
// https://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage(v=vs.110).aspx
MailMessage eml = new MailMessage();
eml.From = new MailAddress("ewriter@example.com", "Emily Writer");
eml.Subject = ".NET email creation sample";
eml.To.Add(new MailAddress("jreader@example.com", "James Reader"));
eml.Body = "Sample email body.";
SmtpClient smtp = new SmtpClient();
smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
smtp.PickupDirectoryLocation = @"C:\My_Sample_Pickup_Directory";
smtp.Send(eml);