Skip to content

No email is sent when recipient email is duplicated #691

Closed

Description

@BotanMan

Issue Summary

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);

Technical details:

  • sendgrid-csharp Version: 9.9.0
  • Platform ASP.NET
  • .NET Version: 4.5.2

Activity

  1. thinkingserious commented on May 4, 2018

    @thinkingserious
    Contributor

    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

  2. Jericho commented on May 6, 2018

    @Jericho

    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.

  3. BotanMan commented on May 10, 2018

    @BotanMan
    Author

    @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.

  4. Jericho commented on May 10, 2018

    @Jericho

    @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.

  5. added a commit that references this issue on Oct 26, 2018
  6. childish-sambino commented on Apr 13, 2020

    @childish-sambino
    Contributor

    Submitted #991 which will ignore duplicate email addresses (case-insensitive, email-only comparison) when serializing the message body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions