Questions tagged [mimekit]

A cross-platform .NET MIME creation and parser library with support for S/MIME, PGP, TNEF and Unix mbox spools.

Filter by
Sorted by
Tagged with
1 vote
1 answer
20 views

Invalid Zip File -ZipArchive

I am trying to create a zip file from a byte[] and return the zip file as a byte[] also but when I upload the bytes to blob storage, the zip file is invalid when I download it. Code: byte[] zipBytes; ...
Liam Kenny's user avatar
0 votes
0 answers
12 views

Mimekit can not attach file

I am using Mimekit email sender. I try to attach a file and all the code to do that errors out. When I add this: var attachments = new AttachmentCollection (); var attachment = attachments.Add(@"...
Kaptindan's user avatar
0 votes
1 answer
38 views

Mimekit or Mailkit or Mail which can allow different from and return path values

Hello I am trying to use any of the libraries Mimekit, Mailkit of net mail to achieve different from and return path emails mainly to help in non delivery reports Example : I want to send the emails ...
Coding_Freak's user avatar
0 votes
1 answer
34 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....
Kok How Teh's user avatar
  • 3,419
0 votes
1 answer
69 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 ...
Alan B's user avatar
  • 4,126
0 votes
1 answer
66 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 ...
trysailmajor's user avatar
0 votes
1 answer
37 views

Find the position of an attachment using MimeKit

I have a MIME email message that I am parsing using MimeKit. I am able to load in the message and get all the attachment entities like so: MimeMessage mimeMessage = MimeMessage.Load(decodedDataStream);...
Milos's user avatar
  • 167
-1 votes
1 answer
35 views

I am trying to sign a mail but get a email with a p7s with my certificates and not a signed email

I have an issue, I do not understand why I have a s/mime certificate for my email; it doesn't sign my email body but generates an attachment with all certificates! Is this a bug or a brand-new way to ...
Walter Verhoeven's user avatar
0 votes
1 answer
346 views

Using MimeKit MimeMessage.Load() fails to parse the entity headers of the email message

I have a simple string representation of an email that I've converted to a memory stream and am trying to load into a MimeMessage however the Load fails parsing the headers. I have also downloaded the ...
Kyle Wood's user avatar
0 votes
1 answer
76 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 ...
Stephen's user avatar
  • 11
1 vote
1 answer
461 views

Is there an available explanation of the difference between MimeKit and MimeKitLite?

Love the MimeKit and MailKit libraries. Work great. Just discovered MimKitLite, but cannot find any info on that is "lite" about it. Is there an explanation somewhere? Thank you. I checked ...
gregsohl's user avatar
0 votes
1 answer
208 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). ...
Rob Schripsema's user avatar
1 vote
1 answer
168 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 ...
Анастасия Качаева's user avatar
0 votes
1 answer
274 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 ...
Richard's user avatar
0 votes
1 answer
296 views

How to convert MimeEntity (message/rfc822) to MimeMessage (MimeKit)

I have an email message that contains an envelope and I want to access the contents of the envelope as a MimeMessage to retrieve the from,to,subject,body & attachment data. The problem is; once I ...
TheLegendaryCopyCoder's user avatar
0 votes
1 answer
214 views

file.OpenReadStream() Cannot access closed stream error

I want Website users to submit a file through a Web form. Sometimes multiple files. Then these files should be emailed to a specific set of users. I have created an Email Service that accepts a List ...
Shawn's user avatar
  • 1
0 votes
1 answer
600 views

How to add an attachment to a loaded MimeMessage (MimeKit) [duplicate]

Is there any general way to add an attachment to a mail read from an stream using MimeKit? I need something like this var message = MimeMessage.Load(inputStream); var newMessage = ...
Yanko Hernández Alvarez's user avatar
1 vote
1 answer
271 views

Cast Amazon SES emails, stored in S3 buckets, to MimeMessage type (MimeKit)

I need to read incoming email messages, with the following constraints: An Amazon SES rule stores the incoming emails to a S3 bucket; These emails then need to be cast to the MimeMessage type, of the ...
StriderHiryu's user avatar
0 votes
1 answer
119 views

Mimekit how to embed svg without attach them

I have this little piece of code var builder = new BodyBuilder(); var image = builder.LinkedResources.Add(logoPath); image.ContentId = MimeUtils.GenerateMessageId(); textMsg = textMsg.Replace("{...
Weenhallo's user avatar
  • 344
0 votes
1 answer
355 views

c# - MailKit imap download attachments in memory/byte[] (No access to the file system)

I need to download attachments from an email, i'm using imap (using MailKit) I don't have access to the file system, I have to convert it to byte[], since I have to store it in an azure storage. I ...
user14299165's user avatar
3 votes
1 answer
1k views

c# Sending Email with Mailkit with an HTML template file that has images imbedded

I would like to send an email using MailKit by linking to an html template that has images imbedded, for the C# part I use this code : var email = new MimeMessage(); var bodyBuilder = new BodyBuilder()...
Hitchb's user avatar
  • 33
0 votes
0 answers
149 views

Can't send email using MimeKit

I am following this article to send email using Mimekit. I have two controllers one is Home Controller and the other is BlogData Controller. Problem is when I try and send email in the BlogData ...
nikhil's user avatar
  • 1,628
6 votes
3 answers
2k views

System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1

I've been using Mailkit 2.15 and now trying to upgrade to v3.4.1. When I upgraded, all its dependencies got installed including System.Runtime.CompilerServices.Unsafe v4.5.3. But when I execute the ...
pradeep's user avatar
  • 195
0 votes
1 answer
478 views

Issues Instantiating Mimekit.MimeMessage in PowerShell "Could not load file of assembly "System.Buffers" as well as "System.Memory"

I am working to build a script that utilizes MailKit and MimeKit to send an email using PowerShell. I built a runnable version of this script on my development machine and am now trying to get it ...
Davis's user avatar
  • 21
0 votes
1 answer
202 views

Unable to load S/MIME encrypted message with MimeKit.LoadAsync

I'm having issues parsing an S/MIME encrypted E-mail message using MimeKit's LoadAsync method. I want to parse it to a MimeMessage object to later decrypt it. The method throws an error Failed to ...
Kuba Chmiel's user avatar
0 votes
0 answers
337 views

.Net Mailkit Pop3 Connection with Proxy Settings

I am trying to connect Pop3 client using given proxy settings. However, I got "Authentication failed" error. When i try it with imap which is with port 993, It works just fine. I cant ...
Kaan Çağhan's user avatar
0 votes
1 answer
153 views

Writing MimeMessage to MemoryStream length/encoding issues when running application with Debian/Docker

I'm facing issues with a .net Core web app (based on Boilerplate / ASP.NET Zero), where we implemented MailKit and MimeKit. We're downloading MimeMessages via IMAP and save them as byte[] in a ...
Ad Rian's user avatar
  • 29
0 votes
1 answer
81 views

MailKit retrieve Email account logo/avatar

I am using Mailkit to programmatically retrieve email messages from email accounts. Is there a standard way using IMAP to retrieve the email account logo/avatar for example from Gmail using MailKit? ...
Radenko Zec's user avatar
  • 7,669
0 votes
0 answers
359 views

MimeKit and saving attachments to the computer problem

I am having the same problem as it is described here: MailKit save Attachments foreach(var attachment in message.Attachments) { using(var stream = File.Create("fileName")) { if (...
HEki's user avatar
  • 23
0 votes
1 answer
133 views

MimeMessage not being added to folder with IMAP

I have the following function which should save a previously sent MimeMessage to the Sent folder of my mailbox. Unfortunately nothing is appended to the sent folder and no error occurs. Public Sub ...
Brobic Vripiat's user avatar
2 votes
1 answer
405 views

MimeKit 3.3.0 problem when using from a Service Library on IIS but not in a Windows Form App

First, a little explanation of why I have 2 issues. This issue is related to v3.3.0 of MimeKit, whereas the other issue arises when I update MimeKit to v3.4.0. As I encountered the issue regarding v3....
Frank Sonne's user avatar
1 vote
1 answer
196 views

MimeKit 3.4.0 runtime problem when going from Dev env. to Test env

A few days ago i updated the MimeKit from 3.3.0 to 3.4.0, but when i move the app from my development environment to my test environment, MimeKit 3.4.0 throws a strange exception: Could not load file ...
Frank Sonne's user avatar
0 votes
1 answer
230 views

MimeKit to read compressed data

Using MimeKit to read MimeMessage like so: var message = MimeMessage.Load("C:\\test\\as2\\RawMIMEMsg.txt"); var part = message.BodyParts.FirstOrDefault(); var ms = new MemoryStream(); part....
katit's user avatar
  • 17.5k
0 votes
1 answer
435 views

Only using Multipart & MimePart in .Net MimeKit

I just started using this. Multipart objMP = new Multipart("related", {"What kind of array goes here?"}); Is there a way I can write to the mimepart from a string instead of from ...
LNC_GoldenAxe's user avatar
1 vote
1 answer
71 views

Differentiating between send or received email

i am developing an application which reads .eml files and extract their data and does some processes with these data with c# i am using MimeKit package. how can I differentiate between sent or ...
AlirezaEiji's user avatar
0 votes
1 answer
1k views

New-Object : Exception calling ".ctor" with "0" argument(s): "The type initializer for 'MimeKit.ParserOptions' threw an exception."

Background: Trying to send an email with Powershell on Win10, and wanting to communicate with an SMTP server using port 587 and TLS 1.2. Trying to use the Nuget Gallery packages: MailKit and its ...
shihpah's user avatar
  • 33
2 votes
1 answer
3k views

How can I send an email with MimeKit in C#

Hi everyone I'm trying to send an email using the MimeKit but I'm trying to attach a .pdf file I have some problems: This is how I'm trying to send it: private bool EnviarMail(string file, string ...
user avatar
0 votes
0 answers
259 views

MimeMessage shows empty body in email in C#?

I want to show html body in mail, I was sending mail through SMTP server using windows service. I write the request in a file & pass this file to MIME.Load() method to read that file and extract ...
D M's user avatar
  • 49
0 votes
1 answer
118 views

MimeKit await client.AuthenticateAsync(username, password) not working with string vars

It's driving me crazzy!! I need to send smtp emails with an email from db (which i can later alter the email and the pwd as well). The thing is...it only connects if i set username and password inside ...
Fernando's user avatar
0 votes
1 answer
183 views

Mimekit send email Apple does not render html

When I send emails through C# using library Mimekit everything is fine, but when I want to open them from the Apple application, the screen is blank (it does not interpret the html or CSS) var email = ...
Fernando Mercado's user avatar
0 votes
2 answers
783 views

MimeKit.ParseException: Unexpected token at offset 18

I have SPA application and asp.net core 3.1 web api and MimeKit for email service. When user register the server sends confirmation email and everything is okay. But on 1 phone device the server ...
Александър К.'s user avatar
0 votes
1 answer
141 views

In MailKit How do I get the UniqueId for a message deleted from the OnMessageExpunged Event

Using Mailkit and monitoring the Inbox I have the callback OnMessageExpunged registered on the Inbox so I can track messages deleted from the Inbox by external influences. Inbox.MessageExpunged += ...
IanH's user avatar
  • 1
0 votes
1 answer
563 views

Headers: get email name/address

Scenario is that I am replying to an original email message. I am populating a new message to send with the required elements of the original message (the original body, reciepient, sender, the reply, ...
AlisonAuto's user avatar
1 vote
1 answer
424 views

MailKit End-of-data rejected: Throttling quota exceeded (.NET Core 3.1)

I searched through many places but i can't find any answer to this exception. I'm trying to develop an e-mail service to send messages with attachments. My project uses .NET Core 3.1 and the mail ...
VieiraHeloisa's user avatar
1 vote
1 answer
2k views

MailKit-MimeKit - How to copy to Sent folder

I ama able to sent SMTP emails using MailKit & MimeKit and outlook is the client tool receiving these mails. Below code has been used and my Inbox has emails received. var email = new MimeMessage {...
Jaish Mathews's user avatar
0 votes
1 answer
265 views

Mimekit - A suitable private key could not be found for decrypting

I'm trying to decrypt and encrypt mime messages with the Mimekit Library, but when I try to import the certificate to the TemporarySecureMimeContext and then decrypt a message I encounter the ...
victor garcia exposito's user avatar
1 vote
1 answer
205 views

Mimekit - Access is denied trying to decrypt

I'm getting this error when trying to decrypt a MIME message: When I decrypt it in my local machine I can decrypt the mail without any problem, but the app deployed in server can't decrypt and results ...
victor garcia exposito's user avatar
0 votes
1 answer
302 views

Mimekit - ASN1 bad tag value met when decrypting graph api mime message

I'm working with mimekit to encrypt and decrypt mime messages and send them via Graph API, the encryption seems to work well but the receiver of the message can't decrypt the message via it's Outlook ...
victor garcia exposito's user avatar
1 vote
1 answer
489 views

Mimekit - Unable to cast object of type 'Org.BouncyCastle.Asn1.DerApplicationSpecific' to type 'Org.BouncyCastle.Asn1.Asn1SequenceParser'

I'm working with mimekit to encrypt and decrypt mime messages and I'm encountering this error everytime I try to decrypt a message: Unexpected object reading content. BouncyCastle.Crypto at Org....
victor garcia exposito's user avatar
0 votes
1 answer
512 views

ASP.NET Core How to pass an IEnumerable String as a Variable in JavaScript

I would like to pass the To Mailbox Address as a parameter with multiple addresses using MimeKit to send a message. If I edit the controller action to include a string with 2 email addresses: var ...
Chris's user avatar
  • 13

1
2 3 4 5
7