PHPMailer Character ñ on recipient address

后端 未结 2 371
甜味超标
甜味超标 2021-01-21 06:07

I\'m getting the next error on phpmailer when trying to send an email to a recipient address containing the letter \"ñ\", e.g.:

Fatal error: Uncaught exce

相关标签:
2条回答
  • 2021-01-21 06:33

    It seems that those kind of chars aren't allowed to be part of the "local part" of the email address http://en.wikipedia.org/wiki/E-mail_address#Local_part.

    0 讨论(0)
  • 2021-01-21 06:45

    Comments below your question suggest that your mailer does simply not support internationalised email addresses. If that's the case, the workaround you can use is to convert the address to its plain US-ASCII equivalent. The encoding used for that is called punycode. For instance:

    lauro.muñoz@live.com.mx
    

    ... becomes

    lauro.xn--muoz-hqa@live.com.mx
    

    ... which should be exactly the same mailbox.

    Disclaimer: I've never worked with internationalised addresses, please test thoroughly.

    0 讨论(0)
提交回复
热议问题