Beispiel #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);
        }
Beispiel #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 Web(credentials);
                if (transporWeb != null)
                {
                    transporWeb.DeliverAsync(myMessage);
                }
            }
            catch
            {
            }
        }