mimekit

get the delivery status of email with mimekit/mailkit library

寵の児 提交于 2021-02-19 04:27:26
问题 I am using @jstedfast Mimekit/Mailkit library, For sending mass email from my app. I want to know how to get the delivery status of each email. This is my first try to get this and after some RnD i got that we have to set or pass report-type=delivery-status some where, but i didn't get any idea where to do that form the doc where i read this. i also try by overriding DeliveryStatusNotification,but got nothing.May be i am going in wrong direction to get the notification/status. protected

MimeKit.MimeMessage to Browser-Renderable HTML

你离开我真会死。 提交于 2021-02-07 01:58:20
问题 Is there a way to convert a MimeKit.MimeMessage to HTML that can be rendered in a web browser? I'm not concerned with message attachments, but would like to be able to display the message body, complete with embedded images, in a browser. I'm new to MimeKit and couldn't locate anything in the API docs for this. Any info is appreciated. EDIT: I didn't find a way to do this natively with MimeKit, but I combined it with the HtmlAgilityPack to parse the MimeMessage.HtmBody and fix the inline

MailKit: How to download all attachments locally from a MimeMessage

≡放荡痞女 提交于 2020-01-24 13:52:25
问题 I have looked at other examples online, but I am unable to figure out how to download and store ALL the attachments from a MimeMessage object. I did look into the WriteTo(), but I could not get it to work. Also wondering whether attachments will be saved according to the original file name, and type inside the email. Here is what I have so far: using (var client = new ImapClient()) { client.Connect(Constant.GoogleImapHost, Constant.ImapPort, SecureSocketOptions.SslOnConnect); client

Mailkit Fetch “Unexpected token in IMAP response: [qstring: ”Multipart message“]”

懵懂的女人 提交于 2020-01-06 08:30:24
问题 I'm getting an ImapProtocolException with a message: "Unexpected token in IMAP response: [qstring: "Multipart message"]" when issuing zInbox.Fetch(uids, MailKit.MessageSummaryItems.UniqueId Or MailKit.MessageSummaryItems.BodyStructure Or MailKit.MessageSummaryItems.Envelope) But on the other hand if I use GetMessage(uids) all goes fine, no error. Here is ProtocolLogger from Fetch (you can notice no Fetch Completed message): C: A00000790 UID FETCH 97824 (UID ENVELOPE BODYSTRUCTURE) S: * 24320

Unable to decrypt p7m using MimeKit

♀尐吖头ヾ 提交于 2020-01-05 07:38:27
问题 I have located my smime.p7m from my email message, I read it as stream and try to decrypt it using MimeKit, but it failed with Operation is not valid due to the current state of the object. using (MemoryStream ms = new MemoryStream(data)) { CryptographyContext.Register(typeof(WindowsSecureMimeContext)); ApplicationPkcs7Mime p7m = new ApplicationPkcs7Mime(SecureMimeType.EnvelopedData, ms); var ctx = new WindowsSecureMimeContext(StoreLocation.CurrentUser); p7m.Verify(ctx, out MimeEntity output)

Mimekit adds the rtf as an attachment and not the body

江枫思渺然 提交于 2019-12-25 16:09:54
问题 Using the following code the rtf body of the winmail.dat file is added as an attachment to the saved email not the body: using (Stream stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None)) { MimeKit.MimeMessage mimeMessage = MimeKit.MimeMessage.Load(stream); int i = 1; foreach (MimeKit.MimePart attachment in mimeMessage.Attachments) { if (attachment.GetType() == typeof(MimeKit.Tnef.TnefPart)) { MimeKit.Tnef.TnefPart tnefPart = (MimeKit.Tnef.TnefPart)attachment; MimeKit

Mimekit adds the rtf as an attachment and not the body

坚强是说给别人听的谎言 提交于 2019-12-25 16:08:52
问题 Using the following code the rtf body of the winmail.dat file is added as an attachment to the saved email not the body: using (Stream stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None)) { MimeKit.MimeMessage mimeMessage = MimeKit.MimeMessage.Load(stream); int i = 1; foreach (MimeKit.MimePart attachment in mimeMessage.Attachments) { if (attachment.GetType() == typeof(MimeKit.Tnef.TnefPart)) { MimeKit.Tnef.TnefPart tnefPart = (MimeKit.Tnef.TnefPart)attachment; MimeKit

Sign and Encrypt on MimeKit

孤人 提交于 2019-12-24 03:14:14
问题 I was required to send signed and encrypted mails to our customers, however, this is my first time with the fight of sign and encrypt (I want to highlight this point). I have tried with OpaqueMail, and MimeKit. Because I really don't understand deeply OpaqueMail and I have my own clients to retrieve emails, I found far better to understand and implement MimeKit. I know it is a rudimentary implementation what I did in the following lines, but it is just the first contact with it and just a

Quote original message in a reply using mailkit

独自空忆成欢 提交于 2019-12-20 03:41:37
问题 There is any way to quote the original message in a reply? e.g.: Hi, I'm fine. Sent at 16/07/15 from: user@mail.com to: Me Hei Jefh, how are you? I know that I can 'attach' the original message in a new message, but I really want to quote the original message. 回答1: There's no MimeKit API to quote a message, but it's not terribly difficult to do. The following code snippet is a good place to start (you may want to customize it a bit). string QuoteMessageBody (MimeMessage message) { using (var

How to send HTML message via Mimekit/Mailkit

随声附和 提交于 2019-12-18 01:32:47
问题 BodyBuilder bodyBuilder = new BodyBuilder(); messageContent.Body = "<b>This is a test mail</b>"; bodyBuilder.HtmlBody = messageContent.Body; I tried to embed my body to a bodybuilder but when I received the email, it returned an empty body. I have an exception that would throw an argument if the body is empty.. 回答1: Using a BodyBuilder like you are doing is probably the easiest way. var bodyBuilder = new BodyBuilder (); bodyBuilder.HtmlBody = "<b>This is some html text</b>"; bodyBuilder