Skip to content

What is the preferred way for bulk sending a lot of emails through Sendgrid API? #660

@ericpopivker

Description

@ericpopivker

I am currently using the following approach:

var tasks = new List<Task>();
for (int i=0; i <100; i++)
{
    var task = SendEmailUsingSendgridApiAsync(message);
    tasks.Add(task);
}

Task.WaitAll(tasks.ToArrayList());

This approach takes 4s for 100 emails vs 20s if I just send emails one by one. So about 5X faster.
(Single email takes 200ms.)

Is there a recommended approach to send 1000s of emails quickly using SendGrid .NET API?
For 100K emails, even using async approach it still will take about an hour.

Also are there plans to just add REST endpoint on Sendgrid API that would allow sending batches of emails (for ex 100 at a time) in a single request. This way you guys can handle it on Sendgrid side.

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