internal void SendEmail()
        {
            ExportHelper.CreatePDF(this.Html, this.AttachmentFileName);

            
            ThreadPool.QueueUserWorkItem(async callback =>
            {
                Processor processor = new Processor(this.Catalog);
                await processor.Send(this.Recipient, this.Subject, this.EmailBody, true, this.AttachmentFileName);
            });

        }
Exemple #2
0
        public async Task ProcessMailQueue()
        {
            IEnumerable<EmailQueue> queue = Database.MailQueue.GetMailInQueue(this.Catalog);

            if (this.IsEnabled())
            {
                foreach (EmailQueue mail in queue)
                {
                    Processor processor = new Processor(this.Catalog);
                    bool success = await processor.Send(mail.SendTo, mail.Subject, mail.Message, false, mail.Attachments.Split(',').ToArray());

                    if (success)
                    {
                        mail.Delivered = true;
                        mail.DeliveredOn = DateTime.UtcNow;
                        Factory.Update(this.Catalog, mail, mail.QueueId);
                    }
                }
            }
        }
Exemple #3
0
 private void Serializer_ImageSaved(object sender, ImageSavedEventArgs e)
 {
     Processor processor = new Processor();
     processor.Send(this.Recipient, this.Subject, this.EmailBody, AttachmentFactory.GetAttachments(e.ImagePath));
 }