4

I'm getting the above mentioned error when I try to send a mail to Seànèéìòóù@XXX.com

I have done all the necessary changes mentioned in the link SmtpException: The client or server is only configured for e-mail addresses with ASCII local-parts but still my code is not working. Could anyone advice on this.

I have added

smtpClient.DeliveryFormat = SmtpDeliveryFormat.International;

and

var addressFrom = new MailAddress("Seànèéìòóù@Dell.com", "Test Name", Encoding.UTF8);

but still not working.

Community
  • 1
  • 1
Sachin jeev
  • 201
  • 4
  • 14
  • What email server are you using? The settings are different if you are using an Outlook Server vs a POP account. When using outlook you must have an outlook account in the local PC containing the settings. So you have to open outlook once on the PC so the account properties and settings are built. The error message I think indicates that there is a local outlook account which doesn't like the Unicode email address. Not sure. Are you using Net 4.5? See following posting : http://stackoverflow.com/questions/35159053/cannot-send-emails-to-addresses-with-scandinavian-characters – jdweng Jun 14 '16 at 16:23
  • Hi jdweng, I'm using .Net 4.5. There is nothing to do with local outlook configuration I think. Because this is called from a WCF service and its hosted in a server. It uses completely different SFTP settings. The WCF service works fine for other email id's but for the above mentioned email id which consists of unicode chars its giving error. – Sachin jeev Jun 14 '16 at 16:38
  • Whenever you use SmtpClient you have to set the NetworkCredential to False if you are not using Outlook (since Net 4.0). Smtp defaults to NetworkCredentails = true. When true SmtpClient attempts to access a local Outlook credential from the default user account. That is why I asked the question. It wasn't clear from your posting that regular email address were working. Read answer 7 at following posting : http://stackoverflow.com/questions/13260772/smtpexception-the-client-or-server-is-only-configured-for-e-mail-addresses-with – jdweng Jun 14 '16 at 20:42

0 Answers0