Questions tagged [mailkit]
MailKit is a cross-platform .NET mail-client library optimized for mobile.
788
questions
0
votes
1
answer
12
views
MailKit log is empty on authentication fail
The following code fails after processing AuthenticateAsync() with error:
MailKit.Security.AuthenticationException: 535: Authentication failed.
Restarting authentication process. ---> MailKit.Net....
0
votes
0
answers
16
views
Set Message as seen with Mailkit using Powershell
I'm trying to write a script in PS to fetch all unseen/unread messages via imap and import them into a SQL-DB. After the import I want to set the message as seen and move it to a subfolder. Everything ...
0
votes
1
answer
20
views
Mailkit `Sender` from a gmail group alias doesn't work?
I am trying to fix the Sender to a GMAIL group alias but the email is always received from the email alias used in AuthenticateAsync
MimeMessage msg = new MimeMessage() {
Sender = MailboxAddress....
0
votes
1
answer
24
views
Plain text message is displayed instead of HTML message
I am using Mailkit to send messages. This is what I am doing:
var multipart = new Multipart("alternative")
{
new TextPart(MimeKit.Text.TextFormat.Html) { Text = messageHtml },
new ...
0
votes
1
answer
24
views
Error: Message failed: Relaying disallowed @ . -C# MailKit Zoho
with the help of following links
Error: Message failed: 553 Relaying disallowed as @ . - NodeMail Zoho
https://help.zoho.com/portal/en/community/topic/hi-i-have-an-error-code-553
I found that my code ...
0
votes
2
answers
55
views
How do you get the MessageID from AWS SES when using SMTP using C#
I am putting this question out there because it took me the better part of two days figuring this out by putting answers together.
I was attempting to receive AWS's MessageID that it assigns to an ...
0
votes
1
answer
47
views
Does Mailkit library for .NET automatically handle SMTP injection?
I'm using Mailkit library (latest version) to send emails for my .NET project. However, I'm having a concern for SMTP injection handling. Does anyone happen to know some references that can confirm ...
0
votes
1
answer
31
views
Adding an attachment to an email wite a MimeKit BodyBuilder takes 20 seconds on a customer site
I have a .NET Windows service that sends emails using MimeKit. It creates a BodyBuilder and attaches a PDF file:
builder.Attachments.Add(fileName);
Where 'fileName' is the full path and filename of a ...
0
votes
0
answers
21
views
HTML templates are not sent properly as programmed
I am stucked while developing an application in c# for bulk mailing purposes . My application is reading predefined HTML templates with recipients details provided in the html template. My application ...
0
votes
1
answer
93
views
How Can I Send Custom Emails with Variables in .NET 6?
Hello I'm creating an API, I found how send emails using Mailkit with Mailtrap for testing purposes.
I share the code that I'm using:
public class EmailService : IEmailService
{
public void ...
0
votes
1
answer
21
views
Why I obtain MailKit.Net.Imap.ImapProtocolException: 'invalid digest response' during Authentication phase with MailKit?
I was trying to connect and authenticate a user with the ImapClient object of MailKit and during authentication the code throws the exception MailKit.Net.Imap.ImapProtocolException: 'invalid digest ...
0
votes
1
answer
51
views
Script runs in VS Code but not Powershell
I am trying to use MailKit/MimeKit to send emails through Powershell. I have a simple script that sends emails successfully when I run it from VS Code, but the same script does not work from ...
0
votes
1
answer
35
views
When receiving a letter via 'mailkit', the from field has an incomprehensible set of characters
In outlook, I send any letter to a contact in the address book. then in my mail client I try to get the from field
var from = message.From.Mailboxes.FirstOrDefault()?.Address;
And it contains the ...
1
vote
1
answer
54
views
c# MailKit Imap Gmail Connection Timeout
I have an asp.net web application, and I want to add a button that calls a helper method that will connect to gmail, find a specific message by messageID, and move it (deleted message) back to the ...
1
vote
2
answers
93
views
C# Method to copy email using MailKit
in this method i try copy email from sourceClient to destinationClient, i what to copy all messeges in INBOX folder to INBOX folder. But have a issue and I don't now how to rerwite this code.
var ...
0
votes
1
answer
62
views
Send Email with OAuth2 - Server Side Authentication without User Interaction
We used so far the Basic Authentication to send an E-Mail with Microsoft office365 from our Server. Now they turned the Basic Authentication off and only OAuth is working.
I looked around in the ...
0
votes
0
answers
70
views
Powershell MailKit.Net.Imap with Exchange 365: "Authentication Failed"
My first question is whether or not this is even possible today?
Half the stuff I'm reading suggests that the only way to get emails from Exchange anymore is Graph API.
Assuming that's not true, what ...
0
votes
2
answers
200
views
Issue with Imapclient connecting via TLS to outlook server using oauth and mailkit nuget package
I created an application to read an outlook mail inbox folder using oauth2 and mailkit nuget package, but while connecting to the server an exception is thrown saying 'The IMAP server has unexpectedly ...
0
votes
1
answer
91
views
Timeout when connecting to SMTP server from aws
I am developing a .net core application that connects to smtp server to send an email. I am using MailKit to connect and send email.
This is what my code looks like
await client.ConnectAsync(...
0
votes
1
answer
72
views
An attempt was made to access a socket in a way forbidden by its access permissions 139.162.44.23:587
var email = new MimeMessage();
email.From.Add(new MailboxAddress("CMPL", "[email protected]"));
email.To.Add(new MailboxAddress("", cu.Email.ToString()));
email.Cc....
0
votes
1
answer
62
views
Using smtp mailkit secure or not for sending emails using third party
While using smtp mailkit to send emails using .net we directly use our email and password for authentication which means sharing our password to third party (smtp mailkit) is it dangerous to work like ...
0
votes
2
answers
72
views
MailKit shows message body as null
So I have hMailServer running locally and send emails using powershell script as shown below:
$SMTPMessage.Subject = "Margin Call Notice 1"
$SMTPMessage.IsBodyHtml = $true
$SMTPMessage.Body =...
0
votes
0
answers
25
views
ASP.NET Core email not sending without attachment - how to troubleshoot?
I am using below code if I upload attachment email is working but if there is no attachment email is not send bit its return 200 ok status.
This is my code
public async Task<ServicePostResponse> ...
-1
votes
1
answer
380
views
ASP.NET Core - How to resolve SmtpClient does not contain a definition for Connect
In ASP.NET Core 7 Web API application I installed NETCore.MailKit-2.1.0 package for e-mail notification.
Then I have this method:
using MailKit.Net.Smtp;
using MimeKit;
private void Send(MimeMessage ...
0
votes
0
answers
83
views
How to synchronize mail on the server and in my application using IMAP(MailKit)
I write my mail client using the MailKit library. The problem arose like this: I cache messages in the local database, for performance. How can I then synchronize the cache in the database and the ...
0
votes
0
answers
34
views
Signing and encrypting e-mails
I am a beginner in encryption and the like and am currently trying to sign and encrypt emails.
Although I am familiar with the concept of private and public keys, I don't seem to understand an ...
0
votes
0
answers
23
views
Problem with Mailkit MoveTo method either hanging or complaining about threads
I have what I believe to be simple code to open an inbox, loop through the messages and move them to trash. For some reason, the MoveTo is hanging for exactly 2 minutes and then failing with a host ...
0
votes
1
answer
263
views
I get an error when using Mailkit to send a Gmail email
I am trying a simple Mailkit set up in Visual Studio App with C#. Have got an App Password and created the mimemessage. However when I create the SmtpClient and send:
`SmtpClient smtpClient = new();
...
0
votes
0
answers
288
views
Authentication Unsuccessful with Mailkit C#
I am trying to use mailkit SDK for C# to send an email for a console app that will run on a schedule. Can confirm that there is no OTP or 2FA configured. Running into the following error message with ...
0
votes
0
answers
20
views
Fluid Email - required privilege is not held by the client
I am working on a mail service and trying to use Fluid Email with mail kit.
When the line await email.SendAsync() is executed, it throws "required privilege is not held by the client "
I ...
0
votes
1
answer
274
views
How can I implement service-to-service authentication with Office365 using the OAuth2 and Mailkit mechanism in Console Application?
Here I want to read E-mail using Office365, Oauth2 in Console Application.
I am Getting Authentication Failed error
Here Account is getting NULL after retrieving authToken.
Below is my App ...
0
votes
1
answer
197
views
How to format email message in asp.net core
I have a template.docx file, which has a Table, indented words to the left and right sides, some paragraphs of text, etc. I want to retain that structure when sending a message. At the moment, it ...
0
votes
1
answer
296
views
MailKit - Get email body as text excluding chains
I am using MailKit in C# to read from my Mail Inbox. I am trying to get the body just a plain text but I can't quite figure out how I do that. I will share the code I have so far.
Essentially I need ...
0
votes
1
answer
148
views
MailKit MS Exchange. SMTP Authentification
My application reads and sends mail through our MS Exchange mail server using Mailkit 2.15.0
Here is my code for reading
private static void ReadEmails()
{
var client = new ImapClient(new ...
0
votes
1
answer
388
views
MailKit SMTP client fails with "Unable to parse status code returned by the server" no matter what I do
I am trying to debug the messages sent by the MailKit SMTP module in the product I support. So I put together a quick C program that is probably the worst SMTP implementation ever (I'm not an ...
0
votes
1
answer
60
views
How to reply with quoted HTML message?
I'm reading the MailKit FAQ on how to reply a HTML message with the quoted original message.
It doesn't explain how you can set both your message and the ReplyVisitor messages to the body. Any idea?
I ...
0
votes
0
answers
31
views
empty inbox folder of an email address without authentication in .net core
I am using a MailKit for sending email. without authentication (as per sever configuration)
with some code like following
using (var client = new MailKit.Net.Smtp.SmtpClient())
{
...
0
votes
2
answers
146
views
Save Images from MimeMessage C# MailKit
I wrote a method that saves all the images from the email. The problem is that it doesn't save images that are contained in div containers. How can this be fixed using MailKit (without installing ...
0
votes
2
answers
746
views
MailKit.Security.AuthenticationException: '535: Authentication Failed'
I am facing Authentication issue from MailKit with correct credentials., issue:'535: Authentication Failed'
var message = new MimeMessage();
message.From.Add(new MailboxAddress("...
0
votes
1
answer
40
views
.NET MailKit read messages from two mailboxes in one account
I'm using Mailkit to read email from Ms Exchange account.
Everything works fine, but what if corm\john.doe had two mailboxes "[email protected]" and "[email protected]".
There is ...
0
votes
1
answer
293
views
A connection attempt failed because the connected party did not properly respond after a period of time. When trying to send email using SmtpClient()
I am trying to send confirm email address using .NET 6 MailKit. But getting the following error
This exception was originally thrown at this call stack:
System.Net.Sockets.Socket....
0
votes
1
answer
166
views
MailKit/MimeKit looking for System.Buffers 4.0.2.0
Using MailKit in a ASP.Net Web API backend to send out emails from the server. Using MailKit and MimeKit 3.6.0 (latest version).
I can get it working just fine in my dev environment (VS 2019 Pro). ...
0
votes
1
answer
106
views
How to use Disconnect when sending bulk emails with Mailkit?
I need to send emails in bulk (each email is different in body and attachments) and I'm doing something like this:
if (client == null) {
client.Connect(...);
client.Authenticate(...);
}
...
0
votes
1
answer
156
views
Mailkit won't connect to gmx.com via Pop3 or Imap
I'm trying to connect to a gmx account I set up for myself, and I can't even get past the Connection phase much less the Authentication phase.
Here's the code, short and sweet:
public ConnectPopClient(...
1
vote
1
answer
145
views
Mimekit changes headers encoding
I have MailMessage, its HeadersEncoding is windows-1251. Then I create MimeMessage with MimeMessage.CreateFromMailMessage(message), but its headers encoded in utf-8.
Why mimekit changes encoding and ...
0
votes
1
answer
81
views
MailKit steam content to string variable C#
I'm using MailKit library with C# to read some emails that contain attachment (xml files); so far i'm able to get the email with the attachement and write it to disk.
using (var stream = File.Create(...
0
votes
1
answer
55
views
MailKit can't search James' old emails?
Development environment: C#, Core 3.1, MailKit 3.5.0, Apache James 3.3.0
Using the same code, after restarting the James service, the old emails will not be found.
using (var imapClient = new ...
0
votes
0
answers
342
views
Sending email using C# often ends up in spam folder
I am sending email from my outlook email using MailKit package of C#.
However, for same email body and subject when I send it using Outlook app, it ends up in recipient inbox. But when I send it using ...
0
votes
1
answer
210
views
Sending email directly using MailKit
All the examples I've seen on using MimeKit/MailKit to send an email has the SMTP client logging into a SMTP server and sending the email through that server. Is it possible to have MimeKit/MailKit ...
0
votes
0
answers
37
views
How inbox and sent folder messages are linked in MailKit?
I try to get messages in inbox folder that where not replied.
At first I used some field in MimeMessage InReplyTo and it was helful.
But today I discovered that some messages that already had replies ...