Проверяем почту
team-for-next@hotmail.com
Открываем
https://office.com
C#
Создаем новое C# консольное приложение... и напишем код
using SendGrid;
using SendGrid.Helpers.Mail;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
internal class Example
{
private static void Main()
{
Execute().Wait();
}
static async Task Execute()
{
var apiKey = "SG.thBR2bwZQxqqPopMOg0...................."; // change Api Key
var client = new SendGridClient(apiKey);
var from = new EmailAddress("team-for...@hotmail.com", "Support");// change email
var subject = "Sending with SendGrid is Fun";
var to = new EmailAddress("aaaa@mail.ru", "Example User");// change email
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);
}
}
}