jstedfast / MailKit

A cross-platform .NET library for IMAP, POP3, and SMTP.
http://www.mimekit.net
MIT License
6.04k stars 809 forks source link

Special Character on Password #1734

Closed RichardKBR closed 3 months ago

RichardKBR commented 3 months ago

Describe the bug Using a special character ¨ (umlaut) in password cause authentication error.

Platform:

Exception Authentication Exception (535 5.7.3 Authentication unsuccessful)

To Reproduce Steps to reproduce the behavior:

  1. Put in youre test account password a character ¨ (umlaut)
  2. Try to send email
jstedfast commented 3 months ago

Please upgrade. 2.15 is years out of date and there won't be any updates to 2.x

RichardKBR commented 3 months ago

Thx ill test!

jstedfast commented 3 months ago

Make sure to add this line of code to your program's startup logic:

System.Text.Encoding.RegisterProvider (System.Text.CodePagesEncodingProvider.Instance);

Then, when authenticating to your SMTP server, use the Authenticate() method that allows you to pass a System.Text.Encoding parameter to tell MailKit which encoding to use when encoding your password.