コード例 #1
0
        public static async Task SendAsync(EmailMessage message, object token = null)
        {
            switch (AppConfig.EmailServiceName)
            {
            //case "SENDGRID":
            //    if (message.Tos.Count > 0)
            //    {
            //        await SendGridEmailHelper.SendMailToMultipleAsync(message);
            //    }
            //    else
            //    {
            //        await SendGridEmailHelper.SendMailAsync(message);
            //    }
            //    break;

            case "SMTP":
                await SmtpEmailHelper.SendUsingSmtpAsync(message, token);

                break;

            case "RELAY":
                await RelayEmailHelper.SendUsingRelayAsync(message, token);

                break;
            }
        }
コード例 #2
0
        public static void Send(EmailMessage message)
        {
            switch (AppConfig.EmailServiceName)
            {
            //case "SENDGRID":
            //    if (message.Tos.Count > 0)
            //    {
            //        SendGridEmailHelper.SendMailToMultiple(message);
            //    }
            //    else
            //    {
            //        SendGridEmailHelper.SendMail(message);
            //    }
            //    break;

            case "SMTP":
                SmtpEmailHelper.SendUsingSmtp(message);
                break;

            case "RELAY":
                RelayEmailHelper.SendUsingRelay(message);
                break;
            }
        }