Thursday, January 16, 2014

.NET error: The client or server is only configured for E-mail addresses with ASCII local-parts: hergé@tintin.be

For a customer project, I created a batch application that every night send hundreds of emails(my own kind of SPAM machine Knipogende emoticon).

Last week, we started getting some errors. When we looked inside the error logs, we found the following error message:

The client or server is only configured for E-mail addresses with ASCII local-parts: hergé@tintin.be

To solve this we have to upgrade our application to .NET 4.5. In .Net 4.5 an extra property was added to the SmtpClient, DeliveryFormat which accepts values of the System.Net.Mail.SmtpDeliveryFormat type. If you change this value to SmtpDeliveryFormat.International, the SmtpClient will happily send any kind of emailadres, no matter what strange characters it contains.

No comments: