Simple WebClient not working: Customized cultures cannot be passed by LCID, only by name
I am trying to send a simple POST request to a URL using WebClient but I am getting
An exception occurred during a WebClient request.
And in InnerException
Customized cultures cannot be passed by LCID, only by name.
Apparently there is no discussion about this exception on the internet.
Here is my code:
public static void Send(string message)
var url = "https://api.mailgun.net/v3/sandbox1ebb54bdb39044988d3c916d833769b7.mailgun.org/messages";
using (var client = new WebClient())
client.Credentials = new NetworkCredential("api", "some_password");
var values = new NameValueCollection();
values["from"] = "Mailgun Sandbox <email@example.com>";
var response = client.UploadValues(url, values);
var responseString = Encoding.Default.GetString(response);
Exception is raised at client.UploadValues(url, values)