Exemple #1
0
 public async Task SendAsync()
 {
     string template = GetTemplate();
     string parsed = ParseTemplate(template);
     string subject = "Welcome to " + HttpContext.Current.Request.Url.Authority;
     string catalog = AppUsers.GetCatalog();
     var email = this.GetEmail(this._user, subject, parsed);
     var queue = new MailQueueManager(catalog, email);
     queue.Add();
     await queue.ProcessMailQueueAsync(EmailProcessor.GetDefault());
 }
        public async Task SendAsync(string catalog, Subscribe model)
        {
            try
            {
                var email = this.GetEmail(catalog, model);
                var manager = new MailQueueManager(catalog, email);
                manager.Add();

                await manager.ProcessMailQueueAsync(EmailProcessor.GetDefault());
            }
            catch
            {
                throw new HttpException(500, "Internal Server Error");
            }
        }
        public async Task SendAsync()
        {
            string template = this.GetTemplate();
            string parsed = this.ParseTemplate(template);
            string subject = "Welcome to " + HttpContext.Current.Request.Url.Authority;
            string catalog = AppUsers.GetCatalog();
            var email = this.GetEmail(this._user, subject, parsed);

            var processor = EmailProcessor.GetDefault(catalog);

            if (string.IsNullOrWhiteSpace(email.ReplyTo))
            {
                email.ReplyTo = processor.Config.FromEmail;
            }

            var queue = new MailQueueManager(catalog, email);
            queue.Add();
            await queue.ProcessMailQueueAsync(processor);
        }
        public async Task SendAsync(string catalog, Subscribe model)
        {
            try
            {
                var email = this.GetEmail(catalog, model);
                var manager = new MailQueueManager(catalog, email);
                manager.Add();

                var processor = EmailProcessor.GetDefault(catalog);

                if (string.IsNullOrWhiteSpace(email.ReplyTo))
                {
                    email.ReplyTo = processor.Config.FromEmail;
                }

                await manager.ProcessMailQueueAsync(processor);
            }
            catch
            {
                throw new HttpException(500, "Internal Server Error");
            }
        }