public static async Task CreateSignUpEmail(string from) { var email = new EmailItem { SendTo = "*****@*****.**", SendFrom = from, Subject = "Wants to be added to mailing list", Message = string.Format("{0}, would like to be added to the Savannah River Brewing Company mailing list.", from) }; await SendEmail(email); }
private static async Task SendEmail(EmailItem item) { var meassage = new SendGridMessage(); meassage.AddTo(item.SendTo); meassage.From = new MailAddress(item.SendFrom); meassage.Subject = item.Subject; meassage.Text = item.Message; var transportWeb = new Web(GetNetworkCredential()); await transportWeb.DeliverAsync(meassage); }