855 questions
0
votes
0
answers
100
views
Cannot authenticate to email account with MailKit
I am trying to use MailKit to access an email account and retrieve mail messages for processing. I have installed the nuget packages for MailKit and MimeKit. I just installed Studio 2022 before ...
0
votes
0
answers
65
views
Hangfire + MailKit: Connection refused due to timeout (even with extended CommandTimeout)
I'm using Hangfire in an ASP.NET Core application to send emails using MailKit. When I enqueue a background job that sends email, it fails with a timeout and returns:
A connection attempt failed ...
0
votes
0
answers
73
views
MailKit SMTP connection lifetime and authenticate with OAuth tokens
We are migrating from System.Net.Mail to MailKit. If we need to send emails every 30 seconds (or may be more frequently) using SMTPClient (connecting to Microsoft Exchange online), is it advisable to ...
1
vote
1
answer
98
views
In C# MimeMessage cannot get complete TextBody
When I try to reach the text body of the email, it cannot load the whole text completely.
This is my code:
string text = message.TextBody;
And the type of message is MimeMessage.
In some emails from ...
0
votes
0
answers
64
views
MailKit.Net.Imap.ImapProtocolException : Idle timeout, closing connection
context: trying to start up mailkit for integration tests.
this works fine on my local machine, but breaks in the pipeline when im starting up the mail server with same parameters for port and ...
1
vote
1
answer
267
views
Unable to load MailKit.dll file in PowerShell
I have installed the MimeKit and the MailKit in my PC using:
Install-Package -Name 'MimeKit' -Source "https://www.nuget.org/api/v2" -SkipDependencies
Install-Package -Name 'MailKit' -Source &...
0
votes
0
answers
64
views
MailKit does not see attachment (content-disposition: inline)
I am tryilng to save attachments from emails using MailKit.
I have emails with attachments, which are not seen by MailKit. When these messages are opened in Outlook I see that they have attachments.
I ...
0
votes
2
answers
170
views
MimeKit not able to send emails using SES SMTP
I developed a C# application that uses MimeKit to send emails through SES. The following code demonstrates this
Note: My server only allows the port - 25.
public virtual bool Send(MimeMail ...
0
votes
0
answers
176
views
Mailkit - C# - 535: 5.7.3 Authentication unsuccessful [PN3PR01CA0013.INDPRD01.PROD.OUTLOOK.COM
I am encountering the error "535: 5.7.3 Authentication unsuccessful [PN3PR01CA0013.INDPRD01.PROD.OUTLOOK.COM]" while using the MailKit library to send an email with Outlook's modern ...
0
votes
2
answers
121
views
SMTP connection fails
In my Blazor server application, I want to use OAuth2 authentication instead of basic auth. Using Mailkit and .NET 8.0.
private async Task<string> CreateSmtpClientAndSendMailAsync()
{
...
0
votes
2
answers
87
views
Emails being parsed with extra Equals Signs scattered through the body on Linux and not Windows
I am using MimeKit to retrieve emails from an Office 365 Exchange server. I'm using the Graph API to do this, so the code to retrieve and create the MimeMessage object is simply:
var mimeContentStream ...
-1
votes
1
answer
133
views
Reading email messages via IMAP
I created some code in C# to read the email from a folder on my (local/NAS) IMAP server. Code is not finished, but in the end I would like to have a list of all the mailsubjects.
The response from ...
0
votes
1
answer
351
views
MailKit SMTP client using StartTLS with self-signed cert
I am using mailKit 4.10.0 to make a SMTPClient. This client will call a custom SMTPServer using StartTls. The SMTPServer is using a self-signed certificate.
Here is the code:
using (var client = new ...
0
votes
2
answers
233
views
SMTPServer - How to support StartTLS?
I have an SMTPClient, using MailKit, that sends a message with the follow code.
using (var client = new SmtpClient())
{
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
...
-1
votes
2
answers
112
views
Razor component list item not updating UI
Beforehand i apologize for any mistakes, as English is not my first language.
I'm creating a razor component library to be implemented in an existent .NET 7 Blazor Server application. Basically a ...
1
vote
1
answer
135
views
MailKit Reply Email Not Threading Correctly with Original Message
When I answer the first (i.e. oldest) email in a thread of mails (between two gmail accounts) using MailKit .NET the recipient recieves the mail in a new, empty thread.
Doing this through the Gmail ...
1
vote
1
answer
356
views
Updated from MailKit 4.8.0 to MailKit 4.9.0 because of FileLoadExceptions and now have similar issue in System.Buffers
I was having an issue, which others have also had, when using MailKit 4.8.0 whereby when attempting to create an instance of MimeMessage, I got a FileLoadException complaining that the version of ...
0
votes
1
answer
276
views
Why is MailKit trying to establish a SSL connection if useSsl is false?
My MailKit code:
var eMail = new MimeMessage();
eMail.From.Add( new MailboxAddress( sender, sender ) );
eMail.To.Add( new MailboxAddress( recipient, recipient ) );
...
0
votes
0
answers
122
views
Troubleshooting 535 5.7.139: SmtpClientAuthentication Disabled Error in MailKit
I have a question. I had this code that used to work perfectly for sending emails using MailKit. However, I recently started getting this error message:
535 5.7.139 Authentication unsuccessful, ...
0
votes
1
answer
201
views
PublicClientApplicationBuilder.AcquireTokenSilent throwing a MsalUiRequiredException 'Grant is expired'
Scenario
ASP.NET Core Web API is being called from a web app. The Web API being tasked with obtaining external users's grant Imap access to continuously read their email utilising MailKit.
This ...
0
votes
1
answer
32
views
Exchange Server Timout issue in .Net Mail Kit
Mail Kit package connect method throw operation timeout exception but EASendMail package send email successfully with same properties in .Net app. You can see written c# code under below.
var host = &...
0
votes
1
answer
47
views
DecodeToAsync does not fill the MemoryStream for a PDF file
I used this code to download the PDF file from attachment. And when I connecting to gmail IMAP it's working great. But when I try to connect another IMAP server DecodeToAsync just can't decode it to ...
0
votes
1
answer
183
views
How to retrieve the full thread of IMAP email message when querying the Inbox?
Using Mailkits (superb) IMAP Api's I need to get the full thread of a message, but when reading the Inbox label I only get the Reply. Here's my small test case...
Initial message sent from Instigators ...
0
votes
1
answer
90
views
MimeKit SMTP Client - exclude recipients in specific domain
I am working on a SMTP sender application and I already went through many options but I still can't find solution.
Problem
I have a test message where in the emil message, I have some TO and CC ...
-1
votes
2
answers
348
views
Send Email using Yahoo and C#
Hello I'm trying to generate send a email for yahoo using Mailkit.
Here's the code below:
var message = new MimeMessage();
message.From.Add(new MailboxAddress("", "[email protected]&...
0
votes
1
answer
704
views
Using Azure Entra ID I cant see Office 365 Exchange Online under 'APIs my organization uses'
I'm using Mailkit to try and read a free MS outlook email account via IMAP.
Now that App Passwords no longer work with outlook apparently we need to use Entra Id.
I'm following this Mailkit guide. I ...
1
vote
1
answer
365
views
mimekit/mailkit email saved as .eml, opened in the New Outlook, won't add attachments
I'm using mailkit/mimekit to create a .eml file. I'm then using ProcessStartInfo to open the .eml file in the default windows application. I'm doing it this way so that the user can add an attachment ...
1
vote
1
answer
83
views
Get raw file name from attachments file Mailkit
This is log from fetch:
var items = client.Inbox.Fetch(new[] { uid }, MessageSummaryItems.BodyStructure | MessageSummaryItems.UniqueId);
foreach (var item in items)
{
var attachments = item....
0
votes
1
answer
2k
views
Getting 5.7.64 TenantAttribution; Relay Access Denied [ValidationStatus of '' is EmptyCertificate], but ONLY when using Identity
This is an interesting one. In my ASP.NET (.NET 8) app with Identity authentication, I have an implementation of IEmailSender<AppUser> (we'll call it IdentityEmailService). The ...
2
votes
0
answers
661
views
Microsoft SMTP OAuth2 authentication in C# with MailKit fails always
I want to send email via my Microsoft email account. Therefor I use MailKit and OAuth2. The problem is, every time, I try to authenticate myself to send emails I get the authentication error:
...
0
votes
1
answer
260
views
How to fix sending e-mails to Gmail in MailKit?
Using MailKit, I want to send a verification code to rescue the password in my application.
I've copied working code that I've previously used:
private async void RescuePassword(object sender, ...
0
votes
1
answer
87
views
Should I distribute the Mailkit System. dependencies
I'm new to MailKit and I see that it has a number of dependencies named "System.xxx" that are in the NuGet package. (vesrion 4.8.0 - I'm using .net 4.7)
Should I include these in the ...
1
vote
0
answers
230
views
VB.NET: '535: 5.7.3 Authentication unsuccessful' error message when trying to send mails using OAuth from an Outlook free account
I'm trying to implement OAuth Authentication in a VB.NET project using MailKit for an Outlook FREE account. Not using Office 365 neither Microsoft Exchange. Just a free and personal Outlook account.
I ...
0
votes
0
answers
51
views
Setting Transport Headers in MImeKit
I am currently attempting to send an email to another domain. I would like to add in/attach a transport header for the email I am sending. Is there any default way I can set a transport header in ...
1
vote
0
answers
116
views
Why is the "From"/Sender address in draft mails always empty? (And how to possibly get it?)
I am trying to download a draft (via IMAP) and send it (via SMTP) to people via MailKit.
Anyway, the problem is not sending or the process in general, but more a conceptual one: The Envelope.From in ...
0
votes
1
answer
177
views
How to use lock an object and use async in the method in MailKit (C#)?
If you use some MailKit method and have some concurrent access on the API, you will get an InvalidOperationException exception like this:
The ImapClient is currently busy processing a command in ...
0
votes
2
answers
338
views
Moving email in Mailkit from one folder to another folder is not working
I am using ImapClient by MailKit and trying to move a message from folder A to folder B after reading the message, but the message is not moved and still exists in folder A. What is the problem?
Here ...
0
votes
2
answers
174
views
How to create (or get) folders in MailKit with multiple sub-folders when they are separated in one string with slashes et al?
I use MailKit for creating a folder. This is simple, I can e.g. call CreateFolderAsync (if I want to async way) on the parent folder.
public async Task<IMailFolder> GetOrCreateFolder(string ...
0
votes
1
answer
150
views
Why MailKit embedded image in Html body is also showing as attachment?
When I am trying to send a mail using MailKit that has a html body with embedded images, the images are showing in the email body but also as attachments.
I don't want attachments, just as mail body ...
0
votes
0
answers
167
views
.Net Email client Application with office 365 accounts
I'm currently integrating SMTP services in my application.
I must state that I don't have any experience with Azure.
My customers have different email providers and I allow them to configure their own ...
-1
votes
2
answers
1k
views
How to send dynamic HTML email with ASP.NET Core?
I have an e-commerce web application consisting of Blazor WASM for the client side, Blazor Server for administration, and Web API for integration with the database and services. After order completion,...
0
votes
1
answer
111
views
Sending RTF body messages to Outlook with MimeKit and Mailkit
Im currently working with MailKit and Mimemessage in sending emails with "plain","html" and "rtf" bodies. Although I am having an issue with sending an email with an rtf ...
0
votes
1
answer
157
views
MimeMesage object throw exception
I created a class library project to send emails using MimeKit and MailKit.
Project Target framework - .NET Framework 4.7.2
MimeKit version - 4.6.0
MailKit version - 4.6.0
public class MailProcess
...
0
votes
1
answer
58
views
MailKit C# "MyExampledomain:DummyPerson <[email protected]>" results in empty from address
MailKit C# MyExampledomain:DummyPerson <[email protected]> results in empty "From" address
I am using Mailkit library (C#) to retrieve emails via IMAP
for an ...
0
votes
1
answer
191
views
Sending Large Attachments Using MimeKit and MailKit [closed]
So basically I would want to send a email with an attachment greater than 25MB minimum, I have tried sending it as multiple attachments (breaking down the data into chunks), but that gives out an ...
0
votes
0
answers
85
views
Issue trying to use NuGet package MailKit in Xamarin project
I'm trying to send emails directly through my Xamarin Android application using MailKit.
I've installed the latest versions of MailKit and MimeKit through NuGet package manager, but when I run the ...
1
vote
1
answer
4k
views
MailKit OAuth2 SMTP Office365 Send Mail
Since Microsoft announced it is removing basic auth smtp support, I am trying to find a different way of sending emails from my application. My applications are backend applications so therefore it ...
2
votes
0
answers
98
views
How do I Troubleshoot a Microsoft.Indentity.Client Access Token when MailKit returns Authentication Failed?
I am building an email automation application to login to a mailbox, extract text and sort the emails etc. I am trying to use the MailKit library but running into some issues logging into the inbox ...
3
votes
0
answers
1k
views
Send Email(Gmail)- SMTP- C#
I want to send an email using SMTP[in c#]. And based on what I understood, I wrote such this code.
using System;
using System.Net;
using System.Net.Mail;
class Program
{
...
-1
votes
1
answer
534
views
Mailkit: How to connect to Office365 Business Account to read emails
I am new using Mailkit in c# and having trouble with connecting with IMAP to an office365 business account. I receive an error message that the authentication failed. I like to create an application ...