opened
migig
username_0
MimeKit has a [very useful adapter](https://username_1.github.io/MimeKit/docs/MimeKit/MimeMessage.html#M:MimeKit.MimeMessage.CreateFromMailMessage%28System.Net.Mail.MailMessage%29) which allows me to convert from `MailMessage` to `MimeMessage`.

Is there something similar which allows me to convert from `System.Net.Mail.SmtpClient` to `MailKit.Net.Smtp.SmtpClient`?

Porting our SMTP code over to MailKit would be easier that way, and of course, the built-in SMTP functionality reads things from `Web.config`, so it's easier to rely on that behavior and then convert/adapt to the type expected by the MailKit library.
Is there an adapter method to create SmtpClient?
issue
created
jstedfast
username_1
No, there is no such API in MailKit. I'm not sure how I would go about making such an adapter, unfortunately.
comment
created
migig
username_0
@username_1 Well what I'd do is just copy all the relevant properties from the source object into a new target object.

However, thinking about this again, I'm not sure this functionality belongs in MailKit. It's a stand-alone library, it doesn't need any baggage from the .NET FCL.
comment
closed
migig
username_0
issue