Updated. Added Config PW, removed useless menu clutter, other QOL fixes.

This commit is contained in:
dylan_banta 2025-02-25 10:27:45 -05:00
parent ab59550658
commit b3585ca5ee
27 changed files with 547 additions and 359 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -37,8 +37,6 @@ namespace SendEmail
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ConfigMenu = new System.Windows.Forms.ToolStripMenuItem();
this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -47,6 +45,8 @@ namespace SendEmail
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ConfigMenu = new System.Windows.Forms.ToolStripDropDownMenu();
this.configToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
@ -87,8 +87,7 @@ namespace SendEmail
// menuStrip1 // menuStrip1
// //
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem, this.fileToolStripMenuItem});
this.editToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
@ -100,6 +99,7 @@ namespace SendEmail
// fileToolStripMenuItem // fileToolStripMenuItem
// //
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.configToolStripMenuItem,
this.exitToolStripMenuItem}); this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
@ -108,25 +108,10 @@ namespace SendEmail
// exitToolStripMenuItem // exitToolStripMenuItem
// //
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22); this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitClick); this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitClick);
// //
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ConfigMenu});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// ConfigMenu
//
this.ConfigMenu.Name = "ConfigMenu";
this.ConfigMenu.Size = new System.Drawing.Size(110, 22);
this.ConfigMenu.Text = "Config";
this.ConfigMenu.Click += new System.EventHandler(this.ConfigClick);
//
// selectAllToolStripMenuItem // selectAllToolStripMenuItem
// //
this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
@ -181,6 +166,19 @@ namespace SendEmail
this.undoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.undoToolStripMenuItem.Size = new System.Drawing.Size(144, 22);
this.undoToolStripMenuItem.Text = "&Undo"; this.undoToolStripMenuItem.Text = "&Undo";
// //
// ConfigMenu
//
this.ConfigMenu.AutoClose = false;
this.ConfigMenu.Name = "ConfigMenu";
this.ConfigMenu.Size = new System.Drawing.Size(61, 4);
//
// configToolStripMenuItem
//
this.configToolStripMenuItem.Name = "configToolStripMenuItem";
this.configToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.configToolStripMenuItem.Text = "Config";
this.configToolStripMenuItem.Click += new System.EventHandler(this.ConfigClick);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@ -212,10 +210,6 @@ namespace SendEmail
private System.Windows.Forms.TextBox EmailInput; private System.Windows.Forms.TextBox EmailInput;
private System.Windows.Forms.ToolStripComboBox FileComboBox; private System.Windows.Forms.ToolStripComboBox FileComboBox;
private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigMenu;
private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
@ -224,6 +218,10 @@ namespace SendEmail
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripDropDownMenu ConfigMenu;
private System.Windows.Forms.ToolStripMenuItem configToolStripMenuItem;
} }
} }

View File

@ -60,4 +60,7 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<metadata name="ConfigMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
</root> </root>

View File

@ -74,7 +74,7 @@ namespace SendEmail
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "Form2"; this.Name = "Form2";
this.Text = "Form2"; this.Text = "Authentication";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -28,7 +28,7 @@ namespace SendEmail
{ {
string input = textBox1.Text; string input = textBox1.Text;
string encryptedInput = Program.Encrypt(input); // Encrypt the user input string encryptedInput = Program.Encrypt(input); // Encrypt the user input
if (encryptedInput == Program.smtp_pass) // If encrypted password is correct if (encryptedInput == Program.config_pass) // If encrypted password is correct
{ {
this.Hide(); // Hide Form2 this.Hide(); // Hide Form2
var form3 = new Form3(); // Create Form3 var form3 = new Form3(); // Create Form3

View File

@ -29,323 +29,350 @@ namespace SendEmail
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
hostTB = new System.Windows.Forms.TextBox(); this.hostTB = new System.Windows.Forms.TextBox();
label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
portTB = new System.Windows.Forms.TextBox(); this.portTB = new System.Windows.Forms.TextBox();
label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
emailTB = new System.Windows.Forms.TextBox(); this.emailTB = new System.Windows.Forms.TextBox();
label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
passwordTB = new System.Windows.Forms.TextBox(); this.passwordTB = new System.Windows.Forms.TextBox();
panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
label6 = new System.Windows.Forms.Label(); this.showSMTPPassBtn = new System.Windows.Forms.Button();
panel2 = new System.Windows.Forms.Panel(); this.label6 = new System.Windows.Forms.Label();
label7 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel();
label8 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label();
fromTB = new System.Windows.Forms.TextBox(); this.fromTB = new System.Windows.Forms.TextBox();
label9 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label();
subjectTB = new System.Windows.Forms.TextBox(); this.subjectTB = new System.Windows.Forms.TextBox();
label10 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label();
bodyTB = new System.Windows.Forms.TextBox(); this.bodyTB = new System.Windows.Forms.TextBox();
deliveryTB = new System.Windows.Forms.TextBox(); this.label11 = new System.Windows.Forms.Label();
label11 = new System.Windows.Forms.Label(); this.panel3 = new System.Windows.Forms.Panel();
panel3 = new System.Windows.Forms.Panel(); this.showConfigPassBtn = new System.Windows.Forms.Button();
label15 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label(); this.configPasswordTB = new System.Windows.Forms.TextBox();
extensionsTB = new System.Windows.Forms.TextBox(); this.label15 = new System.Windows.Forms.Label();
saveBtn = new System.Windows.Forms.Button(); this.label5 = new System.Windows.Forms.Label();
panel4 = new System.Windows.Forms.Panel(); this.extensionsTB = new System.Windows.Forms.TextBox();
infoBox = new System.Windows.Forms.TextBox(); this.saveBtn = new System.Windows.Forms.Button();
panel1.SuspendLayout(); this.panel4 = new System.Windows.Forms.Panel();
panel2.SuspendLayout(); this.infoBox = new System.Windows.Forms.TextBox();
panel3.SuspendLayout(); this.panel1.SuspendLayout();
panel4.SuspendLayout(); this.panel2.SuspendLayout();
SuspendLayout(); this.panel3.SuspendLayout();
this.panel4.SuspendLayout();
this.SuspendLayout();
// //
// hostTB // hostTB
// //
hostTB.Location = new System.Drawing.Point(71, 32); this.hostTB.Location = new System.Drawing.Point(71, 32);
hostTB.Name = "hostTB"; this.hostTB.Name = "hostTB";
hostTB.Size = new System.Drawing.Size(431, 23); this.hostTB.Size = new System.Drawing.Size(431, 23);
hostTB.TabIndex = 0; this.hostTB.TabIndex = 0;
hostTB.MouseEnter += HoverInfo; this.hostTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// label1 // label1
// //
label1.AutoSize = true; this.label1.AutoSize = true;
label1.Location = new System.Drawing.Point(26, 35); this.label1.Location = new System.Drawing.Point(26, 35);
label1.Name = "label1"; this.label1.Name = "label1";
label1.Size = new System.Drawing.Size(32, 15); this.label1.Size = new System.Drawing.Size(32, 15);
label1.TabIndex = 1; this.label1.TabIndex = 1;
label1.Text = "Host"; this.label1.Text = "Host";
// //
// label2 // label2
// //
label2.AutoSize = true; this.label2.AutoSize = true;
label2.Location = new System.Drawing.Point(29, 64); this.label2.Location = new System.Drawing.Point(29, 64);
label2.Name = "label2"; this.label2.Name = "label2";
label2.Size = new System.Drawing.Size(29, 15); this.label2.Size = new System.Drawing.Size(29, 15);
label2.TabIndex = 3; this.label2.TabIndex = 3;
label2.Text = "Port"; this.label2.Text = "Port";
// //
// portTB // portTB
// //
portTB.Location = new System.Drawing.Point(71, 61); this.portTB.Location = new System.Drawing.Point(71, 61);
portTB.Name = "portTB"; this.portTB.Name = "portTB";
portTB.Size = new System.Drawing.Size(431, 23); this.portTB.Size = new System.Drawing.Size(431, 23);
portTB.TabIndex = 2; this.portTB.TabIndex = 2;
portTB.MouseEnter += HoverInfo; this.portTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// label3 // label3
// //
label3.AutoSize = true; this.label3.AutoSize = true;
label3.Location = new System.Drawing.Point(22, 93); this.label3.Location = new System.Drawing.Point(22, 93);
label3.Name = "label3"; this.label3.Name = "label3";
label3.Size = new System.Drawing.Size(36, 15); this.label3.Size = new System.Drawing.Size(36, 15);
label3.TabIndex = 5; this.label3.TabIndex = 5;
label3.Text = "Email"; this.label3.Text = "Email";
// //
// emailTB // emailTB
// //
emailTB.Location = new System.Drawing.Point(71, 90); this.emailTB.Location = new System.Drawing.Point(71, 90);
emailTB.Name = "emailTB"; this.emailTB.Name = "emailTB";
emailTB.Size = new System.Drawing.Size(431, 23); this.emailTB.Size = new System.Drawing.Size(431, 23);
emailTB.TabIndex = 4; this.emailTB.TabIndex = 4;
emailTB.MouseEnter += HoverInfo; this.emailTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// label4 // label4
// //
label4.AutoSize = true; this.label4.AutoSize = true;
label4.Location = new System.Drawing.Point(1, 122); this.label4.Location = new System.Drawing.Point(1, 122);
label4.Name = "label4"; this.label4.Name = "label4";
label4.Size = new System.Drawing.Size(57, 15); this.label4.Size = new System.Drawing.Size(57, 15);
label4.TabIndex = 7; this.label4.TabIndex = 7;
label4.Text = "Password"; this.label4.Text = "Password";
// //
// passwordTB // passwordTB
// //
passwordTB.Location = new System.Drawing.Point(71, 119); this.passwordTB.Location = new System.Drawing.Point(71, 119);
passwordTB.Name = "passwordTB"; this.passwordTB.Name = "passwordTB";
passwordTB.Size = new System.Drawing.Size(431, 23); this.passwordTB.PasswordChar = '●';
passwordTB.TabIndex = 6; this.passwordTB.Size = new System.Drawing.Size(357, 23);
passwordTB.MouseEnter += HoverInfo; this.passwordTB.TabIndex = 6;
this.passwordTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// panel1 // panel1
// //
panel1.BackColor = System.Drawing.SystemColors.ControlLight; this.panel1.BackColor = System.Drawing.SystemColors.ControlLight;
panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
panel1.Controls.Add(label6); this.panel1.Controls.Add(this.showSMTPPassBtn);
panel1.Controls.Add(label4); this.panel1.Controls.Add(this.label6);
panel1.Controls.Add(hostTB); this.panel1.Controls.Add(this.label4);
panel1.Controls.Add(label1); this.panel1.Controls.Add(this.hostTB);
panel1.Controls.Add(portTB); this.panel1.Controls.Add(this.label1);
panel1.Controls.Add(label2); this.panel1.Controls.Add(this.portTB);
panel1.Controls.Add(emailTB); this.panel1.Controls.Add(this.label2);
panel1.Controls.Add(passwordTB); this.panel1.Controls.Add(this.emailTB);
panel1.Controls.Add(label3); this.panel1.Controls.Add(this.passwordTB);
panel1.Location = new System.Drawing.Point(12, 13); this.panel1.Controls.Add(this.label3);
panel1.Name = "panel1"; this.panel1.Location = new System.Drawing.Point(12, 13);
panel1.Size = new System.Drawing.Size(521, 155); this.panel1.Name = "panel1";
panel1.TabIndex = 11; this.panel1.Size = new System.Drawing.Size(521, 155);
this.panel1.TabIndex = 11;
//
// showSMTPPassBtn
//
this.showSMTPPassBtn.Location = new System.Drawing.Point(434, 119);
this.showSMTPPassBtn.Name = "showSMTPPassBtn";
this.showSMTPPassBtn.Size = new System.Drawing.Size(68, 23);
this.showSMTPPassBtn.TabIndex = 18;
this.showSMTPPassBtn.Text = "Show";
this.showSMTPPassBtn.UseVisualStyleBackColor = true;
this.showSMTPPassBtn.Click += new System.EventHandler(this.toggleShowSMTP);
// //
// label6 // label6
// //
label6.AutoSize = true; this.label6.AutoSize = true;
label6.Font = new System.Drawing.Font("Segoe UI", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.label6.Font = new System.Drawing.Font("Segoe UI", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
label6.Location = new System.Drawing.Point(3, 4); this.label6.Location = new System.Drawing.Point(3, 4);
label6.Name = "label6"; this.label6.Name = "label6";
label6.Size = new System.Drawing.Size(132, 25); this.label6.Size = new System.Drawing.Size(132, 25);
label6.TabIndex = 0; this.label6.TabIndex = 0;
label6.Text = "SMTP Settings"; this.label6.Text = "SMTP Settings";
// //
// panel2 // panel2
// //
panel2.BackColor = System.Drawing.SystemColors.ControlLight; this.panel2.BackColor = System.Drawing.SystemColors.ControlLight;
panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
panel2.Controls.Add(label7); this.panel2.Controls.Add(this.label7);
panel2.Controls.Add(label8); this.panel2.Controls.Add(this.fromTB);
panel2.Controls.Add(fromTB); this.panel2.Controls.Add(this.label9);
panel2.Controls.Add(label9); this.panel2.Controls.Add(this.subjectTB);
panel2.Controls.Add(subjectTB); this.panel2.Controls.Add(this.label10);
panel2.Controls.Add(label10); this.panel2.Controls.Add(this.bodyTB);
panel2.Controls.Add(bodyTB); this.panel2.Controls.Add(this.label11);
panel2.Controls.Add(deliveryTB); this.panel2.Location = new System.Drawing.Point(12, 174);
panel2.Controls.Add(label11); this.panel2.Name = "panel2";
panel2.Location = new System.Drawing.Point(12, 174); this.panel2.Size = new System.Drawing.Size(521, 122);
panel2.Name = "panel2"; this.panel2.TabIndex = 12;
panel2.Size = new System.Drawing.Size(521, 155);
panel2.TabIndex = 12;
// //
// label7 // label7
// //
label7.AutoSize = true; this.label7.AutoSize = true;
label7.Font = new System.Drawing.Font("Segoe UI", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.label7.Font = new System.Drawing.Font("Segoe UI", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
label7.Location = new System.Drawing.Point(3, 4); this.label7.Location = new System.Drawing.Point(3, 4);
label7.Name = "label7"; this.label7.Name = "label7";
label7.Size = new System.Drawing.Size(121, 25); this.label7.Size = new System.Drawing.Size(121, 25);
label7.TabIndex = 0; this.label7.TabIndex = 0;
label7.Text = "Mail Settings"; this.label7.Text = "Mail Settings";
//
// label8
//
label8.AutoSize = true;
label8.Location = new System.Drawing.Point(9, 122);
label8.Name = "label8";
label8.Size = new System.Drawing.Size(49, 15);
label8.TabIndex = 7;
label8.Text = "Delivery";
// //
// fromTB // fromTB
// //
fromTB.Location = new System.Drawing.Point(71, 32); this.fromTB.Location = new System.Drawing.Point(71, 32);
fromTB.Name = "fromTB"; this.fromTB.Name = "fromTB";
fromTB.Size = new System.Drawing.Size(431, 23); this.fromTB.Size = new System.Drawing.Size(431, 23);
fromTB.TabIndex = 0; this.fromTB.TabIndex = 0;
fromTB.MouseEnter += HoverInfo; this.fromTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// label9 // label9
// //
label9.AutoSize = true; this.label9.AutoSize = true;
label9.Location = new System.Drawing.Point(23, 35); this.label9.Location = new System.Drawing.Point(23, 35);
label9.Name = "label9"; this.label9.Name = "label9";
label9.Size = new System.Drawing.Size(35, 15); this.label9.Size = new System.Drawing.Size(35, 15);
label9.TabIndex = 1; this.label9.TabIndex = 1;
label9.Text = "From"; this.label9.Text = "From";
// //
// subjectTB // subjectTB
// //
subjectTB.Location = new System.Drawing.Point(71, 61); this.subjectTB.Location = new System.Drawing.Point(71, 61);
subjectTB.Name = "subjectTB"; this.subjectTB.Name = "subjectTB";
subjectTB.Size = new System.Drawing.Size(431, 23); this.subjectTB.Size = new System.Drawing.Size(431, 23);
subjectTB.TabIndex = 2; this.subjectTB.TabIndex = 2;
subjectTB.MouseEnter += HoverInfo; this.subjectTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// label10 // label10
// //
label10.AutoSize = true; this.label10.AutoSize = true;
label10.Location = new System.Drawing.Point(12, 64); this.label10.Location = new System.Drawing.Point(12, 64);
label10.Name = "label10"; this.label10.Name = "label10";
label10.Size = new System.Drawing.Size(46, 15); this.label10.Size = new System.Drawing.Size(46, 15);
label10.TabIndex = 3; this.label10.TabIndex = 3;
label10.Text = "Subject"; this.label10.Text = "Subject";
// //
// bodyTB // bodyTB
// //
bodyTB.Location = new System.Drawing.Point(71, 90); this.bodyTB.Location = new System.Drawing.Point(71, 90);
bodyTB.Name = "bodyTB"; this.bodyTB.Name = "bodyTB";
bodyTB.Size = new System.Drawing.Size(431, 23); this.bodyTB.Size = new System.Drawing.Size(431, 23);
bodyTB.TabIndex = 4; this.bodyTB.TabIndex = 4;
bodyTB.MouseEnter += HoverInfo; this.bodyTB.MouseEnter += new System.EventHandler(this.HoverInfo);
//
// deliveryTB
//
deliveryTB.Location = new System.Drawing.Point(71, 119);
deliveryTB.Name = "deliveryTB";
deliveryTB.Size = new System.Drawing.Size(431, 23);
deliveryTB.TabIndex = 6;
deliveryTB.MouseEnter += HoverInfo;
// //
// label11 // label11
// //
label11.AutoSize = true; this.label11.AutoSize = true;
label11.Location = new System.Drawing.Point(24, 93); this.label11.Location = new System.Drawing.Point(24, 93);
label11.Name = "label11"; this.label11.Name = "label11";
label11.Size = new System.Drawing.Size(34, 15); this.label11.Size = new System.Drawing.Size(34, 15);
label11.TabIndex = 5; this.label11.TabIndex = 5;
label11.Text = "Body"; this.label11.Text = "Body";
// //
// panel3 // panel3
// //
panel3.BackColor = System.Drawing.SystemColors.ControlLight; this.panel3.BackColor = System.Drawing.SystemColors.ControlLight;
panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
panel3.Controls.Add(label15); this.panel3.Controls.Add(this.showConfigPassBtn);
panel3.Controls.Add(label5); this.panel3.Controls.Add(this.label12);
panel3.Controls.Add(extensionsTB); this.panel3.Controls.Add(this.configPasswordTB);
panel3.Location = new System.Drawing.Point(12, 335); this.panel3.Controls.Add(this.label15);
panel3.Name = "panel3"; this.panel3.Controls.Add(this.label5);
panel3.Size = new System.Drawing.Size(521, 155); this.panel3.Controls.Add(this.extensionsTB);
panel3.TabIndex = 13; this.panel3.Location = new System.Drawing.Point(12, 302);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(521, 95);
this.panel3.TabIndex = 13;
//
// showConfigPassBtn
//
this.showConfigPassBtn.Location = new System.Drawing.Point(434, 59);
this.showConfigPassBtn.Name = "showConfigPassBtn";
this.showConfigPassBtn.Size = new System.Drawing.Size(68, 23);
this.showConfigPassBtn.TabIndex = 17;
this.showConfigPassBtn.Text = "Show";
this.showConfigPassBtn.UseVisualStyleBackColor = true;
this.showConfigPassBtn.Click += new System.EventHandler(this.toggleShowConfig);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(1, 63);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(64, 15);
this.label12.TabIndex = 9;
this.label12.Text = "Config PW";
//
// configPasswordTB
//
this.configPasswordTB.Location = new System.Drawing.Point(71, 60);
this.configPasswordTB.Name = "configPasswordTB";
this.configPasswordTB.PasswordChar = '●';
this.configPasswordTB.Size = new System.Drawing.Size(357, 23);
this.configPasswordTB.TabIndex = 8;
this.configPasswordTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// label15 // label15
// //
label15.AutoSize = true; this.label15.AutoSize = true;
label15.Location = new System.Drawing.Point(3, 35); this.label15.Location = new System.Drawing.Point(3, 35);
label15.Name = "label15"; this.label15.Name = "label15";
label15.Size = new System.Drawing.Size(63, 15); this.label15.Size = new System.Drawing.Size(62, 15);
label15.TabIndex = 7; this.label15.TabIndex = 7;
label15.Text = "Extensions"; this.label15.Text = "Extensions";
// //
// label5 // label5
// //
label5.AutoSize = true; this.label5.AutoSize = true;
label5.Font = new System.Drawing.Font("Segoe UI", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.label5.Font = new System.Drawing.Font("Segoe UI", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
label5.Location = new System.Drawing.Point(3, 4); this.label5.Location = new System.Drawing.Point(3, 4);
label5.Name = "label5"; this.label5.Name = "label5";
label5.Size = new System.Drawing.Size(150, 25); this.label5.Size = new System.Drawing.Size(150, 25);
label5.TabIndex = 0; this.label5.TabIndex = 0;
label5.Text = "General Settings"; this.label5.Text = "General Settings";
// //
// extensionsTB // extensionsTB
// //
extensionsTB.Location = new System.Drawing.Point(71, 32); this.extensionsTB.Location = new System.Drawing.Point(71, 32);
extensionsTB.Name = "extensionsTB"; this.extensionsTB.Name = "extensionsTB";
extensionsTB.Size = new System.Drawing.Size(431, 23); this.extensionsTB.Size = new System.Drawing.Size(431, 23);
extensionsTB.TabIndex = 2; this.extensionsTB.TabIndex = 2;
extensionsTB.MouseEnter += HoverInfo; this.extensionsTB.MouseEnter += new System.EventHandler(this.HoverInfo);
// //
// saveBtn // saveBtn
// //
saveBtn.Location = new System.Drawing.Point(12, 497); this.saveBtn.Location = new System.Drawing.Point(12, 403);
saveBtn.Name = "saveBtn"; this.saveBtn.Name = "saveBtn";
saveBtn.Size = new System.Drawing.Size(521, 23); this.saveBtn.Size = new System.Drawing.Size(521, 23);
saveBtn.TabIndex = 14; this.saveBtn.TabIndex = 14;
saveBtn.Text = "Save"; this.saveBtn.Text = "Save";
saveBtn.UseVisualStyleBackColor = true; this.saveBtn.UseVisualStyleBackColor = true;
saveBtn.Click += SaveConfig; this.saveBtn.Click += new System.EventHandler(this.SaveConfig);
// //
// panel4 // panel4
// //
panel4.BackColor = System.Drawing.SystemColors.ControlLight; this.panel4.BackColor = System.Drawing.SystemColors.ControlLight;
panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
panel4.Controls.Add(infoBox); this.panel4.Controls.Add(this.infoBox);
panel4.Location = new System.Drawing.Point(540, 13); this.panel4.Location = new System.Drawing.Point(540, 13);
panel4.Name = "panel4"; this.panel4.Name = "panel4";
panel4.Size = new System.Drawing.Size(171, 507); this.panel4.Size = new System.Drawing.Size(171, 413);
panel4.TabIndex = 15; this.panel4.TabIndex = 15;
// //
// infoBox // infoBox
// //
infoBox.Location = new System.Drawing.Point(4, 5); this.infoBox.Location = new System.Drawing.Point(3, 3);
infoBox.Multiline = true; this.infoBox.Multiline = true;
infoBox.Name = "infoBox"; this.infoBox.Name = "infoBox";
infoBox.ReadOnly = true; this.infoBox.ReadOnly = true;
infoBox.Size = new System.Drawing.Size(162, 497); this.infoBox.Size = new System.Drawing.Size(163, 405);
infoBox.TabIndex = 0; this.infoBox.TabIndex = 0;
// //
// Form3 // Form3
// //
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
ClientSize = new System.Drawing.Size(723, 546); this.ClientSize = new System.Drawing.Size(723, 440);
Controls.Add(panel4); this.Controls.Add(this.panel4);
Controls.Add(saveBtn); this.Controls.Add(this.saveBtn);
Controls.Add(panel3); this.Controls.Add(this.panel3);
Controls.Add(panel2); this.Controls.Add(this.panel2);
Controls.Add(panel1); this.Controls.Add(this.panel1);
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
MaximizeBox = false; this.MaximizeBox = false;
MinimizeBox = false; this.MinimizeBox = false;
Name = "Form3"; this.Name = "Form3";
Text = "Form3"; this.Text = "Send2Email Settings";
panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
panel1.PerformLayout(); this.panel1.PerformLayout();
panel2.ResumeLayout(false); this.panel2.ResumeLayout(false);
panel2.PerformLayout(); this.panel2.PerformLayout();
panel3.ResumeLayout(false); this.panel3.ResumeLayout(false);
panel3.PerformLayout(); this.panel3.PerformLayout();
panel4.ResumeLayout(false); this.panel4.ResumeLayout(false);
panel4.PerformLayout(); this.panel4.PerformLayout();
ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
@ -362,13 +389,11 @@ namespace SendEmail
private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label6;
private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox fromTB; private System.Windows.Forms.TextBox fromTB;
private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox subjectTB; private System.Windows.Forms.TextBox subjectTB;
private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox bodyTB; private System.Windows.Forms.TextBox bodyTB;
private System.Windows.Forms.TextBox deliveryTB;
private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label11;
private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
@ -377,5 +402,9 @@ namespace SendEmail
private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label15;
private System.Windows.Forms.Panel panel4; private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.TextBox infoBox; private System.Windows.Forms.TextBox infoBox;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox configPasswordTB;
private System.Windows.Forms.Button showSMTPPassBtn;
private System.Windows.Forms.Button showConfigPassBtn;
} }
} }

View File

@ -1,15 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO; using System.IO;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Newtonsoft.Json.Linq;
using System.Linq;
using System.Security.Cryptography;
namespace SendEmail namespace SendEmail
{ {
@ -19,6 +11,9 @@ namespace SendEmail
* Form3 is the configuration window for Send2Email * Form3 is the configuration window for Send2Email
*/ */
public bool showingSMTPPass = false;
public bool showingConfigPass = false;
#region UI #region UI
// Default info in the info textbox // Default info in the info textbox
@ -48,7 +43,8 @@ namespace SendEmail
fromTB.Text = Program.mail_from; fromTB.Text = Program.mail_from;
subjectTB.Text = Program.mail_subject; subjectTB.Text = Program.mail_subject;
bodyTB.Text = Program.mail_body; bodyTB.Text = Program.mail_body;
deliveryTB.Text = Program.mail_delivery;
configPasswordTB.Text = Program.Decrypt(Program.config_pass); // Decrypt password for display
extensionsTB.Text = Program.file_extensions; extensionsTB.Text = Program.file_extensions;
} }
@ -58,6 +54,7 @@ namespace SendEmail
{ {
TextBox holder = (TextBox)sender; // Hold onto the sender event that triggered HoverInfo() TextBox holder = (TextBox)sender; // Hold onto the sender event that triggered HoverInfo()
string holdName = holder.Name; // Get the name of the sender that triggered HoverInfo() string holdName = holder.Name; // Get the name of the sender that triggered HoverInfo()
string output; string output;
switch (holdName) // Switch through the possible input fields and sets the output to the correct values switch (holdName) // Switch through the possible input fields and sets the output to the correct values
@ -83,12 +80,12 @@ namespace SendEmail
case "bodyTB": case "bodyTB":
output = "Mail Body: This is what will be put into the body of the email"; output = "Mail Body: This is what will be put into the body of the email";
break; break;
case "deliveryTB":
output = "Mail Delivery: is the message that will appear on screen once the user has successfully emailed themselves";
break;
case "extensionsTB": case "extensionsTB":
output = "File Extensions: This determines the types of files that will be scraped from the Pictures folder.\r\nSeparate each entry with a comma, you do not need to include the period for any extensions.\r\nDefaults: jpg, jpeg, png, gif, bmp, tif, pdf"; output = "File Extensions: This determines the types of files that will be scraped from the Pictures folder.\r\nSeparate each entry with a comma, you do not need to include the period for any extensions.\r\nDefaults: jpg, jpeg, png, gif, bmp, tif, pdf";
break; break;
case "configPasswordTB":
output = "Config Password: The password to access the settings.";
break;
default: default:
output = defaultInfo; output = defaultInfo;
break; break;
@ -97,6 +94,23 @@ namespace SendEmail
SetInfoBox(output); // Send the output text to the info textbox SetInfoBox(output); // Send the output text to the info textbox
} }
public bool toggleHiddenPW(bool isShowing, TextBox passTextBox)
{
isShowing = !isShowing; // Toggle the boolean value
passTextBox.PasswordChar = isShowing ? '\0' : '●'; // Set ● when enabled, empty when disabled
return isShowing; // Return updated value
}
public void toggleShowConfig(object sender, EventArgs e)
{
showingConfigPass = toggleHiddenPW(showingConfigPass, configPasswordTB);
}
private void toggleShowSMTP(object sender, EventArgs e)
{
showingSMTPPass = toggleHiddenPW(showingSMTPPass, passwordTB);
}
#endregion #endregion
#region Save/Load Configuration #region Save/Load Configuration
@ -107,21 +121,21 @@ namespace SendEmail
string cfg_host = hostTB.Text; string cfg_host = hostTB.Text;
string string_cfg_port = portTB.Text; string string_cfg_port = portTB.Text;
string cfg_user = emailTB.Text; string cfg_user = emailTB.Text;
string cfg_pass = Program.Encrypt(passwordTB.Text); // Encrypt the password string cfg_pass = Program.Encrypt(passwordTB.Text); // Encrypt the SMTP password
string cfg_from = fromTB.Text; string cfg_from = fromTB.Text;
string cfg_subject = subjectTB.Text; string cfg_subject = subjectTB.Text;
string cfg_body = bodyTB.Text; string cfg_body = bodyTB.Text;
string cfg_delivery = deliveryTB.Text;
string cfg_extensions = extensionsTB.Text; string cfg_extensions = extensionsTB.Text;
string cfg_config_pass = Program.Encrypt(configPasswordTB.Text); // Encrypt the config password
int cfg_port = Int32.Parse(string_cfg_port); int cfg_port = Int32.Parse(string_cfg_port);
string cfg_public_key = Program.key_public; // Get public key string cfg_public_key = Program.key_public; // Get public key
// Create a JSON object with the configuration data // Create a JSON object with the configuration data
Config cfg = new Config(cfg_host, cfg_port, cfg_user, cfg_pass, cfg_from, cfg_subject, cfg_body, cfg_delivery, cfg_extensions, cfg_public_key); Config cfg = new Config(cfg_host, cfg_port, cfg_user, cfg_pass, cfg_from, cfg_subject, cfg_body, cfg_extensions, cfg_config_pass, cfg_public_key);
// Serialize the JSON data so it can be written to a text file // Serialize the JSON data so it can be written to a text file
string[] json = { JsonConvert.SerializeObject(cfg, Formatting.Indented) }; string[] json = { JsonConvert.SerializeObject(cfg, Formatting.Indented) };
@ -134,6 +148,7 @@ namespace SendEmail
var form1 = new Form1(); var form1 = new Form1();
form1.Closed += (s, args) => this.Close(); form1.Closed += (s, args) => this.Close();
form1.Show(); form1.Show();
LoadConfig(); //Load the new config so that we process any updates the user made.
} }
public static bool LoadConfig() // Boolean method, returns true or false to whatever called LoadConfig public static bool LoadConfig() // Boolean method, returns true or false to whatever called LoadConfig
@ -183,7 +198,8 @@ namespace SendEmail
Program.mail_from = config.Mail_From; Program.mail_from = config.Mail_From;
Program.mail_body = config.Mail_Body; Program.mail_body = config.Mail_Body;
Program.mail_subject = config.Mail_Subject; Program.mail_subject = config.Mail_Subject;
Program.mail_delivery = config.Mail_Delivery;
Program.config_pass = config.Config_Pass;
Program.file_extensions = config.File_Extensions; Program.file_extensions = config.File_Extensions;
Program.key_public = config.Key_Public; // Load public key Program.key_public = config.Key_Public; // Load public key
@ -251,16 +267,14 @@ namespace SendEmail
public int SMTP_Port { get; set; } public int SMTP_Port { get; set; }
public string SMTP_User { get; set; } public string SMTP_User { get; set; }
public string SMTP_Pass { get; set; } public string SMTP_Pass { get; set; }
public string Mail_From { get; set; } public string Mail_From { get; set; }
public string Mail_Subject { get; set; } public string Mail_Subject { get; set; }
public string Mail_Body { get; set; } public string Mail_Body { get; set; }
public string Mail_Delivery { get; set; } public string Config_Pass { get; set; }
public string File_Extensions { get; set; } public string File_Extensions { get; set; }
public string Key_Public { get; set; } // New property public string Key_Public { get; set; } // New property
public Config(string smtp_host, int smtp_port, string smtp_user, string smtp_pass, string mail_from, string mail_subject, string mail_body, string mail_delivery, string file_extensions, string key_public) public Config(string smtp_host, int smtp_port, string smtp_user, string smtp_pass, string mail_from, string mail_subject, string mail_body, string file_extensions, string config_pass, string key_public)
{ {
SMTP_Host = smtp_host; SMTP_Host = smtp_host;
SMTP_Port = smtp_port; SMTP_Port = smtp_port;
@ -270,19 +284,14 @@ namespace SendEmail
Mail_From = mail_from; Mail_From = mail_from;
Mail_Subject = mail_subject; Mail_Subject = mail_subject;
Mail_Body = mail_body; Mail_Body = mail_body;
Mail_Delivery = mail_delivery;
File_Extensions = file_extensions; File_Extensions = file_extensions;
Config_Pass = config_pass;
Key_Public = key_public; // New property Key_Public = key_public; // New property
} }
} }
#endregion #endregion
#endregion #endregion
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
} }
} }

View File

@ -1,64 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <root>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">

View File

@ -32,8 +32,8 @@ namespace SendEmail
public static string mail_from; public static string mail_from;
public static string mail_subject; public static string mail_subject;
public static string mail_body; public static string mail_body;
public static string mail_delivery;
public static string file_extensions; public static string file_extensions;
public static string config_pass;
// Encryption keys (8 bytes for DES) // Encryption keys (8 bytes for DES)
public static string key_secret = "8byteKey"; public static string key_secret = "8byteKey";
@ -52,7 +52,7 @@ namespace SendEmail
bool cont = Form3.LoadConfig(); // Load Configuration method bool cont = Form3.LoadConfig(); // Load Configuration method
if (cont) // If Config exists if (cont) // If Config exists
{ {
if (string.IsNullOrEmpty(smtp_pass)) // Check if password is empty if (string.IsNullOrEmpty(config_pass)) // Check if password is empty
{ {
// Run first time setup // Run first time setup
Application.Run(new Form3()); Application.Run(new Form3());
@ -259,11 +259,11 @@ namespace SendEmail
mail.Attachments.Add(attachment); // Attach the new attachment to the email mail.Attachments.Add(attachment); // Attach the new attachment to the email
} }
SmtpServer.Credentials = new System.Net.NetworkCredential(smtp_user, smtp_pass); // Login to SMTP SmtpServer.Credentials = new System.Net.NetworkCredential(smtp_user, Program.Decrypt(smtp_pass)); // Login to SMTP
SmtpServer.EnableSsl = true; // Use SSL Encryption SmtpServer.EnableSsl = true; // Use SSL Encryption
SmtpServer.Send(mail); // Send our mail variable SmtpServer.Send(mail); // Send our mail variable
MessageBox.Show(mail_delivery + sendTo); // Popup informs user where the email was sent MessageBox.Show("Your scans have been sent to " + sendTo); // Popup informs user where the email was sent
} }
catch (Exception ex) // If the Try fails the catch will output this error message. catch (Exception ex) // If the Try fails the catch will output this error message.
{ {

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Scan2Email.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Scan2Email.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -15,4 +15,25 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="example.cfg.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -15,4 +15,9 @@
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
</Project> </Project>

View File

@ -6,7 +6,7 @@
"Mail_From": "email@company.com", "Mail_From": "email@company.com",
"Mail_Subject": "Mail Subject Text", "Mail_Subject": "Mail Subject Text",
"Mail_Body": "Mail Body Text", "Mail_Body": "Mail Body Text",
"Mail_Delivery": "Mail Delivery Text + {destination_email}", "Config_Pass": "",
"File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf", "File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf",
"Key_Public": "byte8Key" "Key_Public": "byte8Key"
} }