3

I'm trying to move an application that used System.Net.Mail over to MailKit/MimeKit.

Using System.NetMail, you could write messages to a folder like so:

_smtp = new SmtpClient()
{
    DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory,
    PickupDirectoryLocation = path //path could be a string like "C:\Temp"
};

_smtp.Send(message);

Is there a solution to do this using MailKit/MimeKit?

Thanks for the help!

John-Luke Laue
  • 3,736
  • 3
  • 32
  • 60

1 Answers1

8

Yes, but it doesn't involve MailKit's SmtpClient...

Instead, you'd do this:

MimeKit.MimeMessage message = CreateMyMessage ();
message.WriteTo (fileName);
jstedfast
  • 35,744
  • 5
  • 97
  • 110