Last post Jun 29, 2018 05:35 AM by Edward Z
Jun 27, 2018 06:07 AM|Faraz A. Qureshi|LINK
Till now it was going on well until my employer has now started to use the Proxy Server settings for network access, which requires every user the relevant IP be now set and thus email sending has stopped working in my project.
In other words, consider a simple SendGrid sample project like the following works well enough when used upon a network
not requiring any Proxy Server to be set:
public static void Main(string args)
static async Task Execute()
var apiKey = "...........SendGridSampleKey...........";
var client = new SendGridClient(apiKey);
var from = new EmailAddress("firstname.lastname@example.org", "Sender's Name");
var subject = "Sending with SendGrid is Fun";
var to = new EmailAddress("email@example.com", "Receiver");
var plainTextContent = "and easy to do anywhere, even with C#";
var htmlContent = "<strong>and easy to do anywhere, even with C#</strong>";
var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
var response = await client.SendEmailAsync(msg);
With the new requisite Proxy Server settings to be carried out by the Employer (e.g. like Inetcpl.cpl > ConnectionsTab > LANSettingsButton > ProxyServerAddressSet something like xxx.xxx.xxx.xxx : 8080) now the same sample SendGrid code doesn't work.
How to setup proxy settings so as to use the relevant Server within a project?
Jun 27, 2018 02:50 PM|bruce (sqlwork.com)|LINK
if their code does not support proxy credentials, you will need to change to their rest api, and use webclient that does.
Jun 27, 2018 07:21 PM|Faraz A. Qureshi|LINK
Thanks for replying, however how to have the sample simple code be modified so as to use a ProxyServer in this regard? Any sample code shall be more appreciated.
Jun 29, 2018 05:35 AM|Edward Z|LINK
Thanks for your post.
I am afriad your issue is more related with SendGrid, I would suggest you submit your issue below: