Exemplo n.º 1
0
        private IEmailMessage CreateMessage(IEmailProvider provider)
        {
            var message = provider.CreateMessage();

            if (!string.IsNullOrEmpty(to.Text))
            {
                message.To.Add(to.Text);
            }
            if (!string.IsNullOrEmpty(cc.Text))
            {
                message.Cc.Add(cc.Text);
            }
            if (!string.IsNullOrEmpty(bcc.Text))
            {
                message.Bcc.Add(bcc.Text);
            }
            if (!string.IsNullOrEmpty(subject.Text))
            {
                message.Subject = subject.Text;
            }
            if (!string.IsNullOrEmpty(body.Text))
            {
                message.Body = body.Text;
            }
            if (!string.IsNullOrEmpty(files.Text))
            {
                message.AttachmentFilePath.Add(files.Text);
            }
            return(message);
        }
Exemplo n.º 2
0
 internal UsageEmailDialog()
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     richTextBox2.Text  = "May we ask you a favor? We would like to send a tiny e-mail back to the software developers telling us of your progress.\nYou will be able to view the e-mail before it goes out. You do not need to be connected to the Internet right now...the e-mail will just open and you can save it in your outbox.";
     m_topLineText.Text = string.Format(this.m_topLineText.Text, UsageReporter.AppNameToUseInDialogs);
     _emailProvider     = EmailProviderFactory.PreferredEmailProvider();
     _emailMessage      = _emailProvider.CreateMessage();
 }
Exemplo n.º 3
0
        private void button6_Click(object sender, EventArgs e)
        {
            IEmailProvider emailProvider = Palaso.Email.EmailProviderFactory.PreferredEmailProvider();
            IEmailMessage  message       = emailProvider.CreateMessage();

            message.To.Add("*****@*****.**");
            message.AttachmentFilePath.Add("/etc/hosts");
            message.Subject = "Test Message";
            message.Body    = "Just a test message.\nWith more than one\nor two lines";
            message.Send(emailProvider);
        }
Exemplo n.º 4
0
		internal UsageEmailDialog()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			richTextBox2.Text = "May we ask you a favor? We would like to send a tiny e-mail back to the software developers telling us of your progress.\nYou will be able to view the e-mail before it goes out. You do not need to be connected to the Internet right now...the e-mail will just open and you can save it in your outbox.";
			m_topLineText.Text = string.Format(this.m_topLineText.Text, UsageReporter.AppNameToUseInDialogs);
			_emailProvider = EmailProviderFactory.PreferredEmailProvider();
			_emailMessage = _emailProvider.CreateMessage();

		}
Exemplo n.º 5
0
		private IEmailMessage CreateMessage(IEmailProvider provider)
		{
			var message = provider.CreateMessage();
			if (!string.IsNullOrEmpty(to.Text))
				message.To.Add(to.Text);
			if (!string.IsNullOrEmpty(cc.Text))
				message.Cc.Add(cc.Text);
			if (!string.IsNullOrEmpty(bcc.Text))
				message.Bcc.Add(bcc.Text);
			if (!string.IsNullOrEmpty(subject.Text))
				message.Subject = subject.Text;
			if (!string.IsNullOrEmpty(body.Text))
				message.Body = body.Text;
			if (!string.IsNullOrEmpty(files.Text))
				message.AttachmentFilePath.Add(files.Text);
			return message;
		}