예제 #1
0
        /// <summary>
        /// Sends the mail.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        public async Task SendMailAsync <T>(EmailRequest <T> request)
            where T : class
        {
            EmailComposer composer    = new EmailComposer();
            EmailRequest  mailRequest = composer
                                        .SetSubject(request.Subject)
                                        .SetBody(request.Body)
                                        .SetFrom(request.From)
                                        .SetTo(request.To?.ToArray())
                                        .SetCc(request.Cc?.ToArray())
                                        .SetBcc(request.Bcc?.ToArray())
                                        .Build();

            await base.SendMailAsync(mailRequest).ConfigureAwait(false);
        }