예제 #1
0
        public bool Send(SendMailRequest request)
        {
            if (request != null)
            {
                MailMessage mail = new MailMessage();

                mail.SetRecipients(request.MailTo, request.MailCC, request.MailBCC);

                mail.From   = From;
                mail.Sender = Sender;

                mail.Subject         = request.Subject;
                mail.SubjectEncoding = Encoding.UTF8;

                mail.IsBodyHtml   = request.IsBodyHtml;
                mail.BodyEncoding = Encoding.Unicode;
                mail.Body         = request.Body;

                mail.AddAttachments(request.Attachments, ResourceResolver);

                mail.AddHtmlView(request.Body, request.HtmlResources, ResourceResolver);

                return(Send(mail));
            }
            throw new Exception("Request is null");
        }
예제 #2
0
        public bool Send(SendMailRequest request)
        {
            if (request != null)
            {
                MailMessage mail = new MailMessage();

                mail.SetRecipients(request.MailTo, request.MailCC, request.MailBCC);

                mail.From = From;
                mail.Sender = Sender;

                mail.Subject = request.Subject;
                mail.SubjectEncoding = Encoding.UTF8;

                mail.IsBodyHtml = request.IsBodyHtml;
                mail.BodyEncoding = Encoding.Unicode;
                mail.Body = request.Body;

                mail.AddAttachments(request.Attachments, ResourceResolver);

                mail.AddHtmlView(request.Body, request.HtmlResources, ResourceResolver);

                return Send(mail);
            }
            throw new Exception("Request is null");
        }