简体   繁体   中英

Using Mimekit to send to email addresses that contain special characters

I am trying to send an email to an email address: coordinación@test.xxxxx.com that contains special characters using Mailkit via a mail server that has the SMTPUTF8 extension enabled ( have double checked the same by sending a sample test email from a shell script).

Mailkit reports the exception as "The SMTP server doesn't support the SMTPUTF8 extension", is there something I should be doing to encode the email address differently ?.

I have tried using UTF-8 encoding for the MailboxAddress constructor but the results are the same. Please find the protocol log for the same.

Connected to smtp://mail5xx.xx.xxxxx.com:25/?starttls=when-available
S: 220 mail5xx.xx.xxxxx.com ESMTP service ready
C: EHLO [192.xxx.xx.xxx]
S: 250-mail5xx.xx.xxxxx.com says hello
S: 250-ENHANCEDSTATUSCODES
S: 250-PIPELINING
S: 250-CHUNKING
S: 250-8BITMIME
S: 250-AUTH CRAM-MD5 PLAIN LOGIN
S: 250-AUTH=CRAM-MD5 PLAIN LOGIN
S: 250-XACK
S: 250-SIZE 0
S: 250-VERP
S: 250 DSN

Edit: This is no longer a problem for me if I use Mailkit 1.1.4 ( thanks to Jeff for that quick patch), apparently some of the mailservers can send UTF mails even if they don't have the SMTPUTF8 extension enabled, which is strange.

Based on the server response to the EHLO command, it does not support the SMTPUTF8 extension.

Note that if it did support it, then it would be listed in the response like so:

C: EHLO [192.xxx.xx.xxx]
S: 250-mail5xx.xx.xxxxx.com says hello
S: 250-ENHANCEDSTATUSCODES
S: 250-PIPELINING
S: 250-CHUNKING
S: 250-8BITMIME
S: 250-AUTH CRAM-MD5 PLAIN LOGIN
S: 250-AUTH=CRAM-MD5 PLAIN LOGIN
S: 250-XACK
S: 250-SIZE 0
S: 250-VERP
S: 250-DSN
S: 250 SMTPUTF8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM