Sending email with C# sdk gmail block

Hi

I created a SendGrid account (free tier for the moment), and implemented API to send emails from my C# application.

The process seems to work mostly (it ONLY sends a single recipient after a successful credit-card charge), but about half(!) of @gmail.com recipients are rejected and appear in my “blocks” report as:

" 555 5.5.2 Syntax error. p10-20020a170902bd0a00b0014f8706592csi12525509pls.0 - gsmtp"

With different codes..

the code is pretty much the same as instructed:

var client = new SendGridClient(sendGridApi);

var from = new EmailAddress("[email protected]s.com", "My Name");

var to = new EmailAddress(recipient);

var msg = MailHelper.CreateSingleEmail(from, to, subject, "", htmlContent);

var response = await client.SendEmailAsync(msg);

...

again, the code above DOES send emails successfully, but not always, and when not, the response is this opaque "555 5.5.2 Syntax error...."

thanx,

ErezM

Tagged:

Answers

  • Hi @ErezM , It looks like you have posted this content twice. I will remove this post and send my findings to your other post. https://community.twilio.com/twilioquest/discussion/725/sending-email-with-c-sdk-gmail-block

    Please let me know if you have any questions!

  • Hi!

    i actually did. i first looked for something to do with "SendGrid", and thats why i posted it there, but then noticed it's inside "twilioquest" which i dont know anything of... so decided the right place is "right at the gates" (here), since no "sendgrid" discussion seems to exist.

    i thought i then to delete the original one, since it's misplacement - just to find that deleting isnt an option...so here goes.

    if i may ask, maybe deleting the other one makes more sense than this one, unless you think otherwise.

    and while at it, i tried to add "email" and/or "sendgrid" tags to make my post more foundable, but none seem to exist. am i STILL in the wrong place?


    cheers,

    ErezM

If this is an emergency, please contact Twilio Support. This is not an official Support channel. https://support.twilio.com/
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support