这是当我尝试向客户发送电子邮件时,我收到此错误。
无效的URI:无法确定URI的格式
这发生在第4行。我有一个基本的方法来解决本指南,以帮助我向客户发送邮件。
public async static void Sendmail(string email, string name, string Title, string htmlContent)
{
var api = "azure_xxxxxxxxxxx@azure.com";
var client = new SendGridClient(api, "smtp.sendgrid.net");//error here
var from = new EmailAddress("HelloWorld@test.com", "Heeey m8");
var to = new EmailAddress(email, name);
var plainTextContent = Regex.Replace(htmlContent, "<[^>]*>", "");
var msg = MailHelper.CreateSingleEmail(from, to, Title, plainTextContent, htmlContent);
var response = await client.SendEmailAsync(msg);
}
我基本上使用的是Azure Sendgrid。
怎么可能是那个错误?