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

Is it possible to get emails after specific message id

I have implemented IMAP Idle client using this example. https://github.com/jstedfast/MailKit/blob/master/Documentation/Examples/ImapIdleExample.cs I have millions of emails. I am saving message ids of emails as I am reading them. In an event where…
Khalil
  • 1,047
  • 4
  • 17
  • 34
2
votes
1 answer

Open a mail folder in MailKit when there are no folder namespaces

We were having a bit of a problem at a client when trying to open a mail folder and it couldn't be found so I created the below method to try my best to find the folder namespace that the mail folder was under. private FolderNamespace…
TheLethalCoder
  • 6,668
  • 6
  • 34
  • 69
2
votes
1 answer

On Send email, MailKit throws an error in C#

I'm trying to send an email with the MailKit. However, it was working before and now suddenly is not working anymore. I'm able to connect & authenticate but when it reaches the send email, is throwing an error. Error code: MessageNotAccepted Error…
Csibi Norbert
  • 780
  • 1
  • 11
  • 35
2
votes
2 answers

MailKit: How to iterate through recent emails to get the email with a given subject

I’m creating a framework using .NET core 2.1. I used MailKit and tried several methods as explained in their pages and also in StackOverflow but still no luck. So far, I was able to get the UIDs of the recent messages but can’t seem to iterate…
Yohan Blake
  • 1,298
  • 4
  • 21
  • 43
2
votes
1 answer

Why does authenticating with Office365 SMTP claim that the correct credentials are invalid?

I have been attempting to utilise Office 365' SMTP functionality, but have run into difficulties when trying to authenticate with it. This is the code I'm testing with: string host = "smtp.office365.com"; int port = 587; string username =…
Interminable
  • 1,338
  • 3
  • 21
  • 52
2
votes
2 answers

MailKit IMAP Idle - How to access 'done' CancellationTokenSource in CountChanged Event

I am working with the IMAP Idle sample code found here The sample requires a Console.ReadKey to cancel the CancellationTokenSource but makes a suggestion that it could be cancelled in the CountChanged event at the time new mail arrives so long as…
Xiolin
  • 121
  • 10
2
votes
2 answers

Using Mailkit : "The SMTP server has unexpectedly disconnected."

I am trying to use a free SMTP relay from SendGrid to send emails from my ASP.NET application. I can connect to the server, but when I try to authenticate, I get this error : "The SMTP server has unexpectedly disconnected." using (var client = new…
jabir saidi
  • 104
  • 1
  • 3
  • 9
2
votes
1 answer

MailKit - How to get size of each attachment

I want to format attachment info as a string with File Name and File Size I can get FileName in Attachments.ContentDisposition, but Size is null. Is any other way to get? Eg : string.Join(',' + Environment.NewLine,…
Tan Boon Jun
  • 131
  • 12
2
votes
3 answers

When should I use SecureSockOptions or useSsl when connecting using Mailkit

I'm confused on how to use the third parameter when setting up smtp with MailKit. Here is what I have so far: // *************** SEND EMAIL ******************* using (var client = new MailKit.Net.Smtp.SmtpClient(new…
TechGuy
  • 327
  • 3
  • 7
2
votes
1 answer

Using mimekit nuget package (via paket) in common project removes existing System.net.http.dll from other projects referencing common project

I had added a new reference of mimekit library (added mimekit and mailkit via paket) in common project used by several other projects. To use mimekit I used below code: using MimeKit; namespace Project.Common.Email.Interfaces { public interface…
2
votes
1 answer

MailKit MessageId is returning null

var summaries = IMailFolder.Fetch( uids, MessageSummaryItems.UniqueId | MessageSummaryItems.Envelope | MessageSummaryItems.BodyStructure…
Samuel
  • 1,949
  • 4
  • 18
  • 30
2
votes
1 answer

MAILKIT how to Move Messages to folder a get the new UniqueID

MailKit.Net.Imap has MoveTo(...). But if we move the Messages the messages will get new UniqueID (since it's unique by folder). How do I get the new UniqueID of the Message?
Rui Caramalho
  • 455
  • 8
  • 16
2
votes
0 answers

ASP.NET MVC web application unable to send email via SMTP on IIS server hosted by Arvixe

I desperately need help solving this issue. How can I get my deployed app to send emails to any address via SMTP? I am developing a web-based sales-tracking application in Visual Studio 2015 (ASP.NET MVC). The site will be hosted on an Arvixe…
2
votes
1 answer

MailKit Connect no Reaction

i try to connect with a mailserver with Mailkit, but its loading on the ImapClient.connect like forever. I got no reaction, no error and no log. I use .NET Framework 4.5.1 c# Visualstudio. I createt a simple form with textboxes and a button. The…
2
votes
2 answers

MailKit Set MessageFlag Seen after Append

I send a MailKit.Message Async with the MailKit.Net.Smtp.SmtpClient. Then i put the Mail in the send Folder, but the Message Flag is Unseen. I can't set the messageflag in Message build, only after Append, but i found no way to convert the…
Wolfgang Schorge
  • 157
  • 1
  • 10