jstedfast / MailKit

A cross-platform .NET library for IMAP, POP3, and SMTP.
http://www.mimekit.net
MIT License
6.04k stars 809 forks source link

Sending MimeMessage using Mircosoft Graph #1702

Closed dgxhubbard closed 5 months ago

dgxhubbard commented 5 months ago

Does MailKit have a supported way of converting MimeMessage to the JSON expected by Microsoft Graph?

SmtpClient used to work on outlook 365, but now fails. So with this article we can send a simple json formatted message. We use MailKit and MimeMessage in a lot of places in our code but I don't see a simple way to convert MimeMessage to the JSON expected by graph.

Does this feature exist now or can it be added?

jstedfast commented 5 months ago

It looks to me like you can send in MIME format and that's what I'd recommend doing.

The problem with trying to serialize MIME to JSON is that the Outlook JSON message format is not likely to be the same as the JMAP JSON message format (JMAP is a newer standard that is more-or-less a replacement for IMAP based on JSON & HTTP REST).

And then there's Google's JSON message format as well for GMail.

And I'd bet my life on them all being different.