Exemple #1
0
        public void Send(EMailMessage message, object userToken = null)
        {

            // Build mail message
            MailMessage mailMessage = message.ToMailMessage();
            mailMessage.From = new MailAddress(FromAddress);


            MessageQueueItem item = new MessageQueueItem
            {
                Message = mailMessage,
                UserToken = userToken
            };

            // Enqueue message

            queue.Enqueue(item);

            // Initiate despooling queue
            ThreadPool.QueueUserWorkItem(SendNextQueueItem);
        }