Convert this sendgrid example to asp.net?

How could I use the following code in an aspx.cs page? I haven’t worked with Task objects before.

using System;
using System.Threading.Tasks;
using SendGrid;
using SendGrid.Helpers.Mail;

class Program
{
    static async Task Main()
    {
        var apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY");
        var client = new SendGridClient(apiKey);
        var from = new EmailAddress("test@example.com", "Example User");
        var subject = "Sending with Twilio SendGrid is Fun";
        var to = new EmailAddress("test@example.com", "Example User");
        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).ConfigureAwait(false);
    }
}

UPDATE 1:

I'm yet to test the solution mentioned in the comments. I'm trusting it doesn't have an ASP.NET blocking issue described in:

https://github.com/sendgrid/sendgrid-csharp/issues/423

https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html