예제 #1
0
        public void SendEmail(List <String> destinatarios, String asunto, String template, object model)
        {
            var templateReder = new TemplateRender();
            var body          = templateReder.Render(template, model);

            SendEmail(destinatarios, asunto, body);
        }
예제 #2
0
        public void SendEmail(List <String> destinatarios, String asunto, String body)
        {
            try
            {
                var templateReder = new TemplateRender();
                var myMessage     = new SendGridMessage();

                myMessage.AddTo(destinatarios);
                myMessage.From    = new MailAddress(emailFrom, emailFromName);
                myMessage.Subject = asunto;
                myMessage.Html    = body;

                var transporWeb = new SendGrid.Web(credentials);
                if (transporWeb != null)
                {
                    transporWeb.DeliverAsync(myMessage);
                }
            }
            catch
            {
            }
        }