You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No email is sent when recipient email is duplicated #691
When I have duplicates in To list no emails is sent, and no error is thrown
Steps to Reproduce
message.AddTo('igor@gmail.com');
message.AddTo('igor@gmail.com');
var client = new SendGridClient('....api-key...');
await client.SendEmailAsync(message);
@Jericho@thinkingserious
Yeah, but the strangest thing that in that case there is no way to understand that it won't work, no emails, no exceptions. It would be nice to have an exception at least.
@BotanMan I agree. If SendGrid does not allow duplicate recipients it should either automatically filter out these duplicates or throw an exception to let us know that our email is not valid and therefore will not be sent. In the mean time, the only alternative we have is to detect and remove duplicates ourselves. That's why I added this feature to StrongGrid. If SendGrid fix their faulty behavior, the feature I just added will become obsolete but in the mean time I think it's the best solution. Do you agree?
Bottom line is: you are absolutely right that it doesn't make sense for SendGrid to refuse to send our email and not let us know about it.
Activity
thinkingserious commentedon May 4, 2018
Hi @BotanMan,
The underlying API does not support sending duplicate emails. I will leave this open so that we may throw an appropriate error.
Thanks!
With Best Regards,
Elmer
Jericho commentedon May 6, 2018
This seems to be a common issue: this problem has been reported at least 9 times in the last 12 months.
Since this seems to be such a common issue, I added a new feature in the StrongGrid library to automatically filter out duplicate recipients.
BotanMan commentedon May 10, 2018
@Jericho @thinkingserious
Yeah, but the strangest thing that in that case there is no way to understand that it won't work, no emails, no exceptions. It would be nice to have an exception at least.
Jericho commentedon May 10, 2018
@BotanMan I agree. If SendGrid does not allow duplicate recipients it should either automatically filter out these duplicates or throw an exception to let us know that our email is not valid and therefore will not be sent. In the mean time, the only alternative we have is to detect and remove duplicates ourselves. That's why I added this feature to StrongGrid. If SendGrid fix their faulty behavior, the feature I just added will become obsolete but in the mean time I think it's the best solution. Do you agree?
Bottom line is: you are absolutely right that it doesn't make sense for SendGrid to refuse to send our email and not let us know about it.
Fixed issue sendgrid#691
Prevented duplicates when adding Tos, CCs, BCCs sendgrid#691
childish-sambino commentedon Apr 13, 2020
Submitted #991 which will ignore duplicate email addresses (case-insensitive, email-only comparison) when serializing the message body.