Ejemplo n.º 1
0
        public void SendMail()
        {
            QueueTest queueTest = new QueueTest();

            queueTest.BuildQueue();

            ILog log = new LogCounter();

            SendMailProcess sendMailProcess = new SendMailProcess(log);

            sendMailProcess.SetHostAndPort("smtp.hostname.com", 25);

            QueueProcess queueProcess = new QueueProcess();
            Queue        queue        = queueProcess.GetQueue();

            foreach (Recipient recipient in queue.RecipientData)
            {
                sendMailProcess.Send(
                    new MailAddress(queue.TicketData.SenderAddress, queue.TicketData.SenderName),
                    new MailAddress[] { new MailAddress(recipient.Address, recipient.Name) },
                    queue.TicketData.Subject,
                    queue.TicketData.Body
                    );
            }
        }
Ejemplo n.º 2
0
        public void SendMail()
        {
            QueueTest queueTest = new QueueTest();
            queueTest.BuildQueue();

            ILog log = new LogCounter();

            SendMailProcess sendMailProcess = new SendMailProcess(log);

            sendMailProcess.SetHostAndPort("smtp.hostname.com", 25);

            QueueProcess queueProcess = new QueueProcess();
            Queue queue = queueProcess.GetQueue();

            foreach(Recipient recipient in queue.RecipientData)
            {
                sendMailProcess.Send(
                    new MailAddress(queue.TicketData.SenderAddress, queue.TicketData.SenderName),
                    new MailAddress[] { new MailAddress(recipient.Address, recipient.Name) },
                    queue.TicketData.Subject,
                    queue.TicketData.Body
                    );
            }
        }