Esempio n. 1
0
        /// <summary>
        /// Method for create the selected as a ActiveUp.Net.Mail.Message.
        /// </summary>
        /// <returns>The ActiveUp.Net.Mail.Message object.</returns>
        private ActiveUp.Net.Mail.Message CreateSelectedMessage()
        {
            ActiveUp.Net.Mail.Message message = new ActiveUp.Net.Mail.Message();
            MailMessage mailMessage           = this.rightSpine1.GetSelectedMessage();

            if (mailMessage != null)
            {
                Facade facade = Facade.GetInstance();
                ActiveUp.MailSystem.DesktopClient.AccountSettings.AccountInfo accInfo =
                    facade.GetDefaultAccountInfo();

                if (accInfo != null)
                {
                    message.From.Email = accInfo.EmailAddress;
                }

                string   separator  = ",";
                string[] recipients = mailMessage.To.Split(separator.ToCharArray());
                foreach (string r in recipients)
                {
                    // We assign the recipient email
                    message.To.Add(r);
                }

                // We assign the subject
                message.Subject = mailMessage.Subject;

                // We assign the body text
                message.BodyText.Text = this.rightSpine1.GetSelectedMessageBody();
            }
            return(message);
        }
Esempio n. 2
0
        /// <summary>
        /// Method for create a message.
        /// </summary>
        /// <returns></returns>
        private ActiveUp.Net.Mail.Message CreateMessage()
        {
            Facade facade = Facade.GetInstance();

            ActiveUp.MailSystem.DesktopClient.AccountSettings.AccountInfo accInfo =
                facade.GetDefaultAccountInfo();

            ActiveUp.Net.Mail.Message message = new ActiveUp.Net.Mail.Message();

            if (accInfo != null)
            {
                message.From.Email = accInfo.EmailAddress;
            }

            string separator = ",";

            string[] recipients = this.tbTo.Text.Split(separator.ToCharArray());
            foreach (string r in recipients)
            {
                // We assign the recipient email
                message.To.Add(r);
            }

            // We assign the subject
            message.Subject = this.tbSubject.Text;

            // We assign the body text
            message.BodyText.Text = this.htmlEditorControl.InnerText;

            // assign the attachments.
            foreach (ListViewItem item in this.listViewAttachments.Items)
            {
                if (item.Checked)
                {
                    message.Attachments.Add(item.Text, false);
                }
            }

            return(message);
        }