I\'m following the example from SendGrid\'s site and as credentials I\'m pasting it what they gave me in the Azure portal. Still, I get this error message.
public static bool SendMailBySendGrid(string offMail, string mailFormatDetails,string subject,string ccMail=null,string bccMail=null)
{
string mailFromId = System.Configuration.ConfigurationManager.AppSettings["Sender"];
SendGridMessage sndmsg = new SendGridMessage();
sndmsg.From = new MailAddress(mailFromId);
sndmsg.To = new MailAddress[] { new MailAddress(offMail) };
if (!string.IsNullOrEmpty(ccMail))
sndmsg.Cc = new MailAddress[] { new MailAddress(ccMail) };
if(!string.IsNullOrEmpty(bccMail))
sndmsg.Bcc = new MailAddress[] { new MailAddress(bccMail) };
sndmsg.Subject = subject;
sndmsg.Html = "" + mailFormatDetails + "";
bool result= SendEmail(sndmsg);
return result;
}
Include using SendGrid; in your project.