Exemple #1
0
        /// <summary>
        /// Sends mail to Mina meddeladen
        /// </summary>
        /// <param name="Cancel"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public SendPackageResult SendMailToPackage(Mail mail)
        {
            SendPackageResult sentMessageResult = new SendPackageResult();

            //Check if reachable
            var result = IsReachable(mail.Recipient.To);

            if (result != null)
            {
                //Send mail to Mina meddelanden
                sentMessageResult = sendMailToMinaMeddelanden(mail, result);
            }

            return(sentMessageResult);
        }
Exemple #2
0
        /// <summary>
        /// Sends mail to Mina meddelanden, uses a configuration property in ConfigurationService if mail should go through a dispatcher or directly to the mailbox.
        /// </summary>
        /// <param name="mailHelper"></param>
        /// <param name="isReachableResult"></param>
        /// <returns></returns>
        private SendPackageResult sendMessage(Mail mailItem, IsReachableResult isReachableResult)
        {
            var mailHelper     = new MailHelper();
            var mailBox        = mailHelper.GetMailBoxFromIsReachableResult(isReachableResult);
            var messageService = new SE.GOV.MM.Integration.Outlook.BusinessLayer.Service.PackageService();

            SendPackageResult result = null;

            if (ConfigHelper.ConfigurationEntity.UseExternalDispatcher)
            {
                result = messageService.SendPackage(mailItem, mailBox);
                //result = messageService.SendPackage(mailItem, mailBox);
            }
            else
            {
                result = messageService.SendPackageToMailBox(mailItem, mailBox);
            }
            return(result);
        }