Mailkit: Invalid local-part at offset 0

Created on 10 Apr 2017  路  2Comments  路  Source: jstedfast/MailKit

I get a Invalid local-part at offset 0 (MimeKit.ParseException) exception at new MailboxAddress. Could a leading whitespace cause this exception?

I have updated via NuGet to the latest version today. Surprisingly with the old version (1.10), the whitespace mail address worked.

question

Most helpful comment

The address string that you pass to new MailboxAddress should be in its canonical form.

So yes, leading spaces could cause this to fail.

MimeKit got a bit stricter here because it now also adds support for IDN addresses which means it actually has to parse the strings in order to break the string into its component pieces.

All 2 comments

The address string that you pass to new MailboxAddress should be in its canonical form.

So yes, leading spaces could cause this to fail.

MimeKit got a bit stricter here because it now also adds support for IDN addresses which means it actually has to parse the strings in order to break the string into its component pieces.

Thank you for your quick reply. 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rgmills picture rgmills  路  6Comments

dbogatov picture dbogatov  路  7Comments

nik0s100 picture nik0s100  路  3Comments

rhagh picture rhagh  路  5Comments

madu2003 picture madu2003  路  7Comments