コード例 #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
ファイル: EmailService.cs プロジェクト: BikS2013/bUtility
        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");
        }