The multiple character "@" in an email address that does not work with .net 2005

In our application, we send an email to the application user. When our email address is paulo.macedo @ company.com.br @ company, it does not work, except for system.net.mime.mailbnfhelper.readmailaddress

So can an email address have multiple "@" characters and can a .net MailMessege object handle it?

+4
source share
2 answers

It is possible to have multiple @ signs, but you must put the other in quotation marks.

+4
source

No, this is not a valid email address. See RFC-5322, section 3.4.1 and section 3.2.3 for lists of characters allowed in each part (definition of atoms).

To have multiple '@' characters, you need to use quoted strings . Apparently MailAddress does not support these (but does not document). I am running .NET 3.5 on a Win7 machine, and MailAddress throws a FormatException when you throw one of them.

+6
source

Source: https://habr.com/ru/post/1347552/


All Articles