I'm trying to send an email using SendGrid API with an API Key I already have.
The problem is: I have to do this from an old .net application, whose asp.net framework version is 3.5 (and changing framework version is not an option)
I'm failing to find useful information on how to achieve it. The only code I found makes use of SendGrid csharp libraries, and these do not support asp.net framework 3.5
This is the code sample I found here, but I cannot make this work from my .net 3.5 web app:
// using SendGrid's C# Library - https://github.com/sendgrid/sendgrid-csharp
using System.Net.Http;
using System.Net.Mail;
var myMessage = new SendGrid.SendGridMessage();
myMessage.AddTo("test@sendgrid.com");
myMessage.From = new MailAddress("you@youremail.com", "First Last");
myMessage.Subject = "Sending with SendGrid is Fun";
myMessage.Text = "and easy to do anywhere, even with C#";
var transportWeb = new SendGrid.Web("SENDGRID_APIKEY");
transportWeb.DeliverAsync(myMessage);
// NOTE: If you're developing a Console Application, use the following so that the API call has time to complete
// transportWeb.DeliverAsync(myMessage).Wait();
Any ideas?