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
11
votes
4 answers

Using System.Net.Mail in ASP NET MVC 6 project

I have trouble creating a simple mock mail sender within an ASP NET 5 project. Here the method : public static Task SendMail(string Email, string Subject, string Body) { SmtpClient client = new SmtpClient(); …
10
votes
1 answer

How to use MailKit with IMAP for Exchange with OAuth2 for daemon / non-interactive apps

I have a daemon that reads the inbox of an email address and performs actions to the emails. I'm using MailKit to connect to the exchange server with IMAP but Microsoft has shut down basic authentication for us (at 4am, without warning...). So I…
laurian
  • 739
  • 6
  • 18
10
votes
2 answers

How to use MailKit with Google after May 30, 2022?

Up to this point I was happily connecting to my Gmail account with a method similar to this: public async Task> GetMessagesAsync() { using var imapClient = new MailKit.Net.Imap.ImapClient(); var secureSocketOptions =…
Pawel
  • 891
  • 1
  • 9
  • 31
10
votes
1 answer

Reply to a Mail in Mailkit

i'm using Mailkit library (Imap) for my project. I can comfortably send a new message by SmtpClient. currently I'm digging about how to reply to a particular mail. and is it possible to add more recipients to that reply mail ? @jstedfast thanks…
10
votes
1 answer

Forward email using MailKit (C#)

I'm trying to access to an IMAP account using MailKit (created by jstedfast) I manage to download the message (as a MimeMessage), and at some point I need to "forward" it to another account. How would be the best way to do it, in order to preserve…
Xavi Ivars
  • 634
  • 8
  • 22
10
votes
2 answers

Saving attachments using MailKit library ?

I'm trying to learn how to use the MailKit library but I am struggling to retrieve attachments. So far my code will open a mailbox, go through each message and store data such as sender, subject, body, date etc. but I can't deal with attachments. I…
Supernatix
  • 465
  • 2
  • 4
  • 14
9
votes
1 answer

MailKit, Office 365 and OAUTH2: Problem in authentication of a server side app

I have to build a .Net console application that runs on server side as a batch, and sends email to recipients using Office365 and MailKit. Our company has recently introduced MultiFactor Authentication; I have already rewrite an interactive app that…
Paolo Ursini
  • 270
  • 1
  • 2
  • 9
9
votes
2 answers

MailKit.Net.Smtp.SmtpClient SMTP server does not support authentication

I'd like to use MailKit to send an email through our Exchange server, using the credentials of the process. Building up a System.Net.Mail.SmtpClient and NetworkCredential with domain/username/password works, but while using…
Ezhumalai
  • 163
  • 1
  • 2
  • 10
9
votes
1 answer

Send a single email to multiple recipients using Mailkit or mimekit

Please do not mark it as a duplicate question because the solution exists for mail message, not for mailkit. I am trying to send an email to multiple addresses. I tried using the code below but I have not tried using a loop. var message =…
Reply not
  • 311
  • 1
  • 3
  • 12
9
votes
1 answer

Is it possible to use default network credentials with Mailkit and Exchange?

I'd like to use MailKit to send an email through our Exchange server, using the credentials of the process. Building up a NetworkCredential with domain/username/password works: using (var client = new SmtpClient(ProtocolLogger)) { …
JamesD
  • 440
  • 6
  • 16
9
votes
1 answer

Collecting SMTP server using Mailkit with Mimekit

While trying to send an e-mail using MailKit and MimeKit,is there a way to collect the SMTP Output?. ps: I am trying to migrate my email code from Easymail to Mimekit and Mailkit and I apologize if this is a rather basic query.
9
votes
1 answer

how to get uid in mailkit?

my code is: using (ImapClient client = new ImapClient()) { // Connect to the server and authentication and then var inbox = client.Inbox; inbox.Open(FolderAccess.ReadOnly); int messageCount = inbox.Count - 1; for (int i =…
shahroz
  • 359
  • 1
  • 6
  • 17
8
votes
4 answers

How do I connect to Exchange Online using OAuth 2.0 in MailKit?

I have a web application that sends e-mails to users via Exchange Online (Office365) using MailKit and Basic Authentication. Our company is MS partner and therefor is obligated to turn off Basic Authentication for our services by the end of february…
8
votes
5 answers

Send mail with Gmail SMTP using MailKit SMTP Client in .NET core 2.2 is not working for me

I'm using NLog an target to send log to some emails using smtp.google.com:587 SMTP server. When I'm using standard System.Net.Mail.SmtpClient library it's working without any problems but when using MailKit it throw me error: Error sending mail.…
GetTaxSolutions
  • 111
  • 1
  • 1
  • 6
8
votes
3 answers

MailKit From Address

Im using mailKit in asp mvc core to collect email from a IMAP mailbox. I return the message using the command var message = inbox.GetMessage(uid) This returns all the results of the message. From here i want to access the sender email address (not…
PowerMan2015
  • 1,307
  • 5
  • 19
  • 40
1
2
3
52 53