- forestpadsolution.zip
- ForestPad
- _EncryptPasswordTest
- CustomInstaller
- ForestPad.sln
- ForestPadCE
- AssemblyInfo.cs
- BuildCabs
- Clipboard.cs
- Data
- Graphics
- Branch.png
- branch_normal.png
- branch_selected.png
- BranchSelected.png
- BranchUnSelected.png
- Forest.png
- forest_normal.png
- forest_selected.png
- ForestPadCE_Splash.png
- ForestSelected.png
- ForestUnSelected.png
- Leaf.png
- leaf_normal.png
- leaf_selected.png
- LeafSelected.png
- LeafUnSelected.png
- NodeSelected.png
- NodeUnselected.png
- Tree.png
- tree_normal.png
- tree_selected.png
- TreeSelected.png
- TreeUnSelected.png
- HelpTopics.xml
- DefaultForestPadSettings.Config
- ForestPadApplication.ico
- ForestPadCE.cs
- ForestPadCE.csdproj
- ForestPadCE.csdproj.user
- ForestPadCE.ico
- ForestPadCE.resx
- obj
- Release
- vsd_config.txt.ARM
- vsd_config.txt.ARMV4
- vsd_config.txt.ARMV4T
- vsd_config.txt.MIPS
- vsd_config.txt.SH3
- vsd_config.txt.SH4
- vsd_config.txt.WCE420X86
- vsd_config.txt.X86
- Settings.cs
- Settings.resx
- SplashScreen.cs
- SplashScreen.resx
- Syncronize.cs
- Syncronize.resx
- Topics.cs
- Topics.resx
- Web References
- ForestPadService
- ForestPadCE_Setup
- ForestPadCE.ico
- ForestPadCE_PPC.ARM.CAB
- ForestPadCE_PPC.ARMV4.CAB
- ForestPadCE_PPC.MIPS.CAB
- ForestPadCE_PPC.SH3.CAB
- ForestPadCE_PPC.WCE420X86.CAB
- ForestPadCE_PPC.X86.CAB
- ForestPadCE_Setup.vdproj
- Setup.Ini
- ForestPadDesktop
- ForestPadDesktop_Setup
- forest_normal.png
- ForestPadDesktop.ico
- ForestPadDesktop_Setup.vdproj
- ForestPadService
- ForestPadUtilities
- ForestPadWeb
- forestpaddesktop_setup.zip
- ForestPadDesktop_Setup.msi
- forestpadce_setup.zip
- ForestPadCE_Setup.msi
|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Web.Mail;
namespace ForestPadDesktop
{
/// <summary>
/// Summary description for EmailText.
/// </summary>
public class EmailText : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBoxTextToEmail;
private System.Windows.Forms.TextBox textBoxSubject;
private System.Windows.Forms.Label labelTo;
private System.Windows.Forms.Label labelBcc;
private System.Windows.Forms.Label labelSubject;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBoxBcc;
private System.Windows.Forms.TextBox textBoxCc;
private System.Windows.Forms.TextBox textBoxTo;
private System.Windows.Forms.Button buttonSend;
private System.Windows.Forms.Button buttonCancel;
private string smtpServerName;
private string fromAddress;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public EmailText(string SmtpServerName, string FromAddress)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
smtpServerName = SmtpServerName;
fromAddress = FromAddress;
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBoxTextToEmail = new System.Windows.Forms.TextBox();
this.textBoxSubject = new System.Windows.Forms.TextBox();
this.textBoxBcc = new System.Windows.Forms.TextBox();
this.textBoxCc = new System.Windows.Forms.TextBox();
this.textBoxTo = new System.Windows.Forms.TextBox();
this.labelTo = new System.Windows.Forms.Label();
this.labelBcc = new System.Windows.Forms.Label();
this.labelSubject = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.buttonSend = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBoxTextToEmail
//
this.textBoxTextToEmail.Location = new System.Drawing.Point(8, 144);
this.textBoxTextToEmail.Multiline = true;
this.textBoxTextToEmail.Name = "textBoxTextToEmail";
this.textBoxTextToEmail.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBoxTextToEmail.Size = new System.Drawing.Size(400, 232);
this.textBoxTextToEmail.TabIndex = 4;
this.textBoxTextToEmail.Text = "";
this.textBoxTextToEmail.WordWrap = false;
//
// textBoxSubject
//
this.textBoxSubject.Location = new System.Drawing.Point(56, 112);
this.textBoxSubject.Name = "textBoxSubject";
this.textBoxSubject.Size = new System.Drawing.Size(352, 20);
this.textBoxSubject.TabIndex = 3;
this.textBoxSubject.Text = "";
//
// textBoxBcc
//
this.textBoxBcc.Location = new System.Drawing.Point(56, 88);
this.textBoxBcc.Name = "textBoxBcc";
this.textBoxBcc.Size = new System.Drawing.Size(352, 20);
this.textBoxBcc.TabIndex = 2;
this.textBoxBcc.Text = "";
//
// textBoxCc
//
this.textBoxCc.Location = new System.Drawing.Point(56, 64);
this.textBoxCc.Name = "textBoxCc";
this.textBoxCc.Size = new System.Drawing.Size(352, 20);
this.textBoxCc.TabIndex = 1;
this.textBoxCc.Text = "";
//
// textBoxTo
//
this.textBoxTo.Location = new System.Drawing.Point(56, 40);
this.textBoxTo.Name = "textBoxTo";
this.textBoxTo.Size = new System.Drawing.Size(352, 20);
this.textBoxTo.TabIndex = 0;
this.textBoxTo.Text = "";
//
// labelTo
//
this.labelTo.Location = new System.Drawing.Point(8, 40);
this.labelTo.Name = "labelTo";
this.labelTo.TabIndex = 6;
this.labelTo.Text = "To:";
//
// labelBcc
//
this.labelBcc.Location = new System.Drawing.Point(8, 88);
this.labelBcc.Name = "labelBcc";
this.labelBcc.Size = new System.Drawing.Size(96, 23);
this.labelBcc.TabIndex = 7;
this.labelBcc.Text = "Bcc:";
//
// labelSubject
//
this.labelSubject.Location = new System.Drawing.Point(8, 112);
this.labelSubject.Name = "labelSubject";
this.labelSubject.TabIndex = 8;
this.labelSubject.Text = "Subject:";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 64);
this.label1.Name = "label1";
this.label1.TabIndex = 9;
this.label1.Text = "Cc:";
//
// buttonSend
//
this.buttonSend.Location = new System.Drawing.Point(8, 8);
this.buttonSend.Name = "buttonSend";
this.buttonSend.Size = new System.Drawing.Size(80, 24);
this.buttonSend.TabIndex = 5;
this.buttonSend.Text = "Send";
this.buttonSend.Click += new System.EventHandler(this.buttonSend_Click);
//
// buttonCancel
//
this.buttonCancel.Location = new System.Drawing.Point(328, 384);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(80, 23);
this.buttonCancel.TabIndex = 6;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// EmailText
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(416, 410);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonSend);
this.Controls.Add(this.textBoxTo);
this.Controls.Add(this.textBoxCc);
this.Controls.Add(this.textBoxBcc);
this.Controls.Add(this.textBoxSubject);
this.Controls.Add(this.textBoxTextToEmail);
this.Controls.Add(this.labelTo);
this.Controls.Add(this.labelBcc);
this.Controls.Add(this.labelSubject);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "EmailText";
this.ResumeLayout(false);
}
#endregion
private void buttonSend_Click(object sender, System.EventArgs e)
{
try
{
MailMessage message = new MailMessage();
message.To = textBoxTo.Text;
message.From = fromAddress;
message.Cc = textBoxCc.Text;
message.Bcc = textBoxBcc.Text;
message.Subject = textBoxSubject.Text;
message.Body = textBoxTextToEmail.Text;
SmtpMail.SmtpServer = smtpServerName;
SmtpMail.Send(message);
}
catch(Exception ex)
{
MessageBox.Show("Problem sending email: " + ex.ToString());
}
finally
{
this.Close();
}
}
public void SetText(string Text)
{
textBoxTextToEmail.Text = Text;
textBoxTextToEmail.Refresh();
}
private void buttonCancel_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.