Questions tagged [mailkit]

MailKit is a cross-platform .NET mail-client library optimized for mobile.

MailKit is a cross-platform .NET mail-client library optimized for mobile, it is built on top of MimeKit.

785 questions
2
votes
1 answer

MailKit: Trying to implement IMAP Client in ASP.NET Core for Receiving new mail event

I'm trying to implement an IMAP client in my ASP.NET Core web project so that it can run on its own thread, whenever a new email comes the MailRecieved event will get fired and I'm receiving parsing the email body and saving in DB. But the issue is…
tech2avinash
  • 73
  • 2
  • 11
2
votes
1 answer

MailKit.Net.Imap read Gmail attachments when "Content-Disposition; inline" is set

I have a c# console application that I use to search a Gmail account for emails with attachments and download them. I am using MailKit.Net.Imap.ImapClient to do this. If the email has been sent with the "Content-Disposition; attachment" set then all…
2
votes
2 answers

MVC email template engine .netcoreapp1.1

I'm new with ASP.NET Core and I am trying to make emails, based on templates. I want to include tags, which are then replaced with specific data from the controller. I found a engine called razorengine that was exectly what I was looking for, but it…
2
votes
1 answer

MailKit: Message not delete from Inbox when gmail setting Conversation view on

I'm working with MailKit lib and have a problem. My application is read specify email in Inbox (Gmail), and delete them. IList listUid = inbox.Search(query); for (int i = 0; i < listUid.Count; i++) { var message =…
user1234
  • 25
  • 9
2
votes
2 answers

Mailkit: Converting HtmlBody to pdf using iTextSharp XMLWorker throws "The document has no pages"

I'm trying to convert the HtmlBody of the e-mails I get from a mailserver using Mailkit and looks like iTextSharp doesn't really like the html I'm passing it. My method works well with a "sample" html code but I get a The document has no pages error…
Gonzo345
  • 1,133
  • 3
  • 20
  • 42
2
votes
2 answers

"The IMAP server has unexpectedly disconnected" using 993 port and MailKit

I recently moved my code to MailKit library because I was using S22.Imap but I saw the maintenance wasn't that great. I previously connected with my own mailserver through 143 and 993, but there is no way to do it through 993 and MailKit. It just…
Gonzo345
  • 1,133
  • 3
  • 20
  • 42
2
votes
1 answer

Setting the body of a mimemessage removes other details

Leading on from my previous question, if I set the body of a MimeMessage the attachments, bodyparts, from and all the details are removed. How can I get around this? foreach (MimeKit.MimeEntity bodyPart in tnefMessage.BodyParts) { if…
TheLethalCoder
  • 6,668
  • 6
  • 34
  • 69
2
votes
2 answers

get the undeliverable email address with mimekit/mailkit library

I started using @jstedfast Mimekit/Mailkit library, which is great by the way, to pull undeliverables using its subject line for search. I tried using the message.to, message.resentto. how do i get that information. My first try today. I was able…
CyberNinja
  • 872
  • 9
  • 25
2
votes
1 answer

MailKit C# ImapClient.Connect() to Office 365 generating exception: "The remote certificate is invalid according to the validation procedure"

I have a problem connecting to Office 365 using Imap and MailKit. The exception I get is The remote certificate is invalid according to the validation procedure https://github.com/jstedfast/MailKit Code: imapClient = new…
Ogglas
  • 62,132
  • 37
  • 328
  • 418
2
votes
1 answer

MailKit dotnet core on Ubuntu 16.04

Running a Kestrel server managed by systemd using www-data user. When trying to send an email using MailKit with TLS enabled I get the following error message: System.UnauthorizedAccessException: Access to the path…
v7d
  • 91
  • 1
  • 5
2
votes
2 answers

5.7.0 User not authenticated in asp.net core1 with mailkit and strato server

In asp.net core 1 app I'm trying to send email with mailkit library(version 1.8.1) to strato server. My code: var emailMessage = new MimeKit.MimeMessage(); try { emailMessage.From.Add(new MimeKit.MailboxAddress("Support",…
Sasha
  • 833
  • 1
  • 20
  • 40
2
votes
1 answer

MailKit: The IMAP server replied to the 'EXAMINE' command with a 'BAD' response

I got this error on an Exchange 2007 mailbox. I see it is returning the BAD response from the error which is thrown by MailKit: The IMAP server replied to the 'EXAMINE' command with a 'BAD' response. But this doesn't tell me enough detail. So I am…
mike nelson
  • 21,218
  • 14
  • 66
  • 75
2
votes
1 answer

Mailkit How to send and check aysynchronous SMTP

So there are some great examples on the net of how to use Mailkit to send an email via SMTP. Typically ending with : client.Authenticate(theSMTPUsername,theSMTPPassword); client.Send(emailMessage); client.Disconnect(true); However this is no good…
Hughgo
  • 1,319
  • 5
  • 17
  • 26
2
votes
2 answers

Unexpected " The remote certificate is invalid according to the validation procedure."

I am trying to connect to an SMTP server from a .NetCore/Ubuntu machine via Mailkit. I am attempting to connect to port 25 on the server with SSL turned off. The mail server is a windows server on the local lan, and works fine from other machines…
Hughgo
  • 1,319
  • 5
  • 17
  • 26
2
votes
1 answer

MailKit and mulitple clients on same mail account

Is there any limits on how many concurrent clients you can connect to one mail account? I have an app that opens a new ImapClient on each request. The ImapClient will open INBOX and FolderA, and move a mail by UID from one to another. The multiple…
grmihel
  • 784
  • 3
  • 15
  • 40