Javamail problem with ñ characters in mail addresses

后端 未结 6 627
花落未央
花落未央 2021-01-19 01:16

I\'m having problems with parse method when usising ñ character:

essage.setRecipients(Message.RecipientType.TO, internetAddress.parse(\"somedir.         


        
6条回答
  •  滥情空心
    2021-01-19 01:48

    To send emails to addresses with non printable characters (like ñ), you must encode the email address using UTF-8.

    Accented characters were not allowed by original RFC 5322 Internet Message Format. But since, RFC 6532 (Internationalized Email Headers) offered a way to use international characters in email addresses.

    Check this StackOverflow question for more details.

提交回复
热议问题