Added Public Key to config file.

This commit is contained in:
unknown 2024-05-24 23:39:48 -04:00
parent ee3b809e13
commit 6deb90f02d
36 changed files with 365 additions and 266 deletions

Binary file not shown.

Binary file not shown.

View File

@ -4,9 +4,6 @@ A simple application to send files of specified filetypes in the Pictures folder
You will need to edit the cfg.json file with the necessary data and place it in You will need to edit the cfg.json file with the necessary data and place it in
C:\Users\\[USER]\AppData\Local\Send2Email for each user that will be using the application. C:\Users\\[USER]\AppData\Local\Send2Email for each user that will be using the application.
//TODO: Create the cfg.json file automatically
//TODO: Create support for HTTP GET request to fetch cfg.json from a trusted server instead of having it available locally on the machine
##### SMTP_Host ##### SMTP_Host
* You'll need to connect to an SMTP Server host to send email. * You'll need to connect to an SMTP Server host to send email.
* Default: smtp.google.com * Default: smtp.google.com
@ -23,8 +20,8 @@ C:\Users\\[USER]\AppData\Local\Send2Email for each user that will be using the a
##### SMTP_Pass ##### SMTP_Pass
* This is the password for the SMTP_User that you'll be logging into to send emails from. * This is the password for the SMTP_User that you'll be logging into to send emails from.
* This is also the password you'll use when you choose Edit > Config from the file menu to access a GUI editor for the cfg.json file. * This is also the password you'll use when you choose Edit > Config from the file menu to access a GUI editor for the cfg.json file.
* Note you will need the cfg.json file to at least exist in the AppData folder, as the software will not run without detecting cfg.json. * If the Password is empty, it will open the Config menu automatically as a first time setup. The password is encrypted when saved to the config file.
* Default: N/A * Default: Empty String
##### Mail_From ##### Mail_From
* This is what will show in the "From" section of the email. This has only been tested with the same data as SMTP_User. * This is what will show in the "From" section of the email. This has only been tested with the same data as SMTP_User.
@ -56,7 +53,7 @@ The final file should look something like this.
"SMTP_Host": "smtp.gmail.com", "SMTP_Host": "smtp.gmail.com",
"SMTP_Port": 587, "SMTP_Port": 587,
"SMTP_User": "email@company.com", "SMTP_User": "email@company.com",
"SMTP_Pass": "smtp_password", "SMTP_Pass": "",
"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",

View File

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

View File

@ -101,7 +101,6 @@ namespace SendEmail
#region Save/Load Configuration #region Save/Load Configuration
// Save the configuration data, will overwrite existing settings
// Save the configuration data, will overwrite existing settings // Save the configuration data, will overwrite existing settings
private void SaveConfig(object sender, EventArgs e) private void SaveConfig(object sender, EventArgs e)
{ {
@ -119,8 +118,10 @@ namespace SendEmail
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
// 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); 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);
// 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) };
@ -135,7 +136,6 @@ namespace SendEmail
form1.Show(); form1.Show();
} }
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
{ {
// Config filepath in AppData // Config filepath in AppData
@ -186,11 +186,11 @@ namespace SendEmail
Program.mail_delivery = config.Mail_Delivery; Program.mail_delivery = config.Mail_Delivery;
Program.file_extensions = config.File_Extensions; Program.file_extensions = config.File_Extensions;
Program.key_public = config.Key_Public; // Load public key
return true; return true;
} }
#endregion #endregion
#region Read/Write Files #region Read/Write Files
@ -258,8 +258,9 @@ namespace SendEmail
public string Mail_Delivery { get; set; } public string Mail_Delivery { get; set; }
public string File_Extensions { get; set; } public string File_Extensions { get; set; }
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) 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)
{ {
SMTP_Host = smtp_host; SMTP_Host = smtp_host;
SMTP_Port = smtp_port; SMTP_Port = smtp_port;
@ -272,10 +273,16 @@ namespace SendEmail
Mail_Delivery = mail_delivery; Mail_Delivery = mail_delivery;
File_Extensions = file_extensions; File_Extensions = file_extensions;
Key_Public = key_public; // New property
} }
} }
#endregion #endregion
#endregion #endregion
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
} }
} }

View File

@ -1,4 +1,64 @@
<root> <?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: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

@ -37,7 +37,7 @@ namespace SendEmail
// Encryption keys (8 bytes for DES) // Encryption keys (8 bytes for DES)
public static string key_secret = "8byteKey"; public static string key_secret = "8byteKey";
public static string key_public = "byte8Key"; public static string key_public; // Moved to config file
#endregion #endregion
#region Main Method #region Main Method

View File

@ -7,5 +7,6 @@
"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}", "Mail_Delivery": "Mail Delivery Text + {destination_email}",
"File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf" "File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf",
"Key_Public": "byte8Key"
} }

View File

@ -7,5 +7,6 @@
"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}", "Mail_Delivery": "Mail Delivery Text + {destination_email}",
"File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf" "File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf",
"Key_Public": "byte8Key"
} }

View File

@ -7,5 +7,6 @@
"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}", "Mail_Delivery": "Mail Delivery Text + {destination_email}",
"File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf" "File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf",
"Key_Public": "byte8Key"
} }

View File

@ -15,7 +15,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Scan2Email")] [assembly: System.Reflection.AssemblyCompanyAttribute("Scan2Email")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+daf994e3473892e2d3f416244465215be628e416")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ee3b809e13f0ae9f5dce01a761dc48001ef9536d")]
[assembly: System.Reflection.AssemblyProductAttribute("Scan2Email")] [assembly: System.Reflection.AssemblyProductAttribute("Scan2Email")]
[assembly: System.Reflection.AssemblyTitleAttribute("Scan2Email")] [assembly: System.Reflection.AssemblyTitleAttribute("Scan2Email")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
012917e426dd4f3ab17677a1a189225eee36982a44ce084e05d182ed8f9b1e80 e5e562f7aeac6e8464ebe455b45520e611a1803f8cae2393ff43c3381b38aa11

View File

@ -6,6 +6,6 @@ build_property.ApplicationHighDpiMode =
build_property.ApplicationUseCompatibleTextRendering = build_property.ApplicationUseCompatibleTextRendering =
build_property.ApplicationVisualStyles = build_property.ApplicationVisualStyles =
build_property.RootNamespace = Scan2Email build_property.RootNamespace = Scan2Email
build_property.ProjectDir = Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\ build_property.ProjectDir = Z:\Users\Software\Git\Send2Email\SendEmail\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =

View File

@ -62,3 +62,35 @@ Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\obj\Release\netcoreapp3.1\
Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.dll Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.dll
Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.pdb Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.pdb
Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.genruntimeconfig.cache Z:\Users\Software\Git\Send2Email\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.genruntimeconfig.cache
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.csproj.AssemblyReference.cache
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\SendEmail.Form1.resources
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\SendEmail.Form2.resources
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\SendEmail.Form3.resources
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.csproj.GenerateResource.cache
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.GeneratedMSBuildEditorConfig.editorconfig
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.AssemblyInfoInputs.cache
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.AssemblyInfo.cs
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.csproj.CoreCompileInputs.cache
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.dll
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.pdb
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Scan2Email.exe
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Scan2Email.deps.json
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Scan2Email.runtimeconfig.json
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Scan2Email.runtimeconfig.dev.json
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Scan2Email.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Scan2Email.pdb
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.AspNetCore.Http.Abstractions.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.AspNetCore.Http.Features.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.Configuration.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.Configuration.Abstractions.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.Configuration.FileExtensions.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.Configuration.Json.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.Configuration.UserSecrets.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.DependencyInjection.Abstractions.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.FileProviders.Abstractions.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.FileProviders.Physical.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.FileSystemGlobbing.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Microsoft.Extensions.Primitives.dll
Z:\Users\Software\Git\Send2Email\SendEmail\bin\Release\netcoreapp3.1\Newtonsoft.Json.dll
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.csproj.CopyComplete
Z:\Users\Software\Git\Send2Email\SendEmail\obj\Release\netcoreapp3.1\Scan2Email.genruntimeconfig.cache

View File

@ -6,11 +6,12 @@
"version": "3.1.0" "version": "3.1.0"
}, },
"additionalProbingPaths": [ "additionalProbingPaths": [
"C:\\Users\\dylan\\.dotnet\\store\\|arch|\\|tfm|", "C:\\Users\\Dylan Windows PC\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\dylan\\.nuget\\packages", "C:\\Users\\Dylan Windows PC\\.nuget\\packages",
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
], ],
"configProperties": { "configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true "Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true
} }
} }

View File

@ -1 +1 @@
8c1bdf5dee4c07deb3124682605c284dcc39ab22791eb91fe37fe0e17dd7212f c1b096280878d435fc97564483bd714fca661c33dbf8c797b967d50035ed5bc4

View File

@ -1,17 +1,17 @@
{ {
"format": 1, "format": 1,
"restore": { "restore": {
"Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\Scan2Email.csproj": {} "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\Scan2Email.csproj": {}
}, },
"projects": { "projects": {
"Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\Scan2Email.csproj": { "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\Scan2Email.csproj": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\Scan2Email.csproj", "projectUniqueName": "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\Scan2Email.csproj",
"projectName": "Scan2Email", "projectName": "Scan2Email",
"projectPath": "Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\Scan2Email.csproj", "projectPath": "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\Scan2Email.csproj",
"packagesPath": "C:\\Users\\Dylan Windows PC\\.nuget\\packages\\", "packagesPath": "C:\\Users\\Dylan Windows PC\\.nuget\\packages\\",
"outputPath": "Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\obj\\", "outputPath": "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"

View File

@ -474,11 +474,11 @@
"project": { "project": {
"version": "1.0.0", "version": "1.0.0",
"restore": { "restore": {
"projectUniqueName": "Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\Scan2Email.csproj", "projectUniqueName": "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\Scan2Email.csproj",
"projectName": "Scan2Email", "projectName": "Scan2Email",
"projectPath": "Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\Scan2Email.csproj", "projectPath": "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\Scan2Email.csproj",
"packagesPath": "C:\\Users\\Dylan Windows PC\\.nuget\\packages\\", "packagesPath": "C:\\Users\\Dylan Windows PC\\.nuget\\packages\\",
"outputPath": "Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\obj\\", "outputPath": "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\obj\\",
"projectStyle": "PackageReference", "projectStyle": "PackageReference",
"fallbackFolders": [ "fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"

View File

@ -1,8 +1,8 @@
{ {
"version": 2, "version": 2,
"dgSpecHash": "BSQKXoo3MpX0OtWH1WUAbG/cC9mx0rGjhOmvRquk7U9DAbeE/z/haJrtoizAsPtlejOn3FrsST/NzvboodLG9Q==", "dgSpecHash": "I7kmGhRqVi8gZTEZBB9tB+FD3L5FgfNOc91HiZd9WxUWHVD9ehLviN7wgHTnSUj6oGuxf02CR0ksdasIHgDuJQ==",
"success": true, "success": true,
"projectFilePath": "Z:\\Users\\Software\\Git\\Send2Email\\Send2Email\\SendEmail\\Scan2Email.csproj", "projectFilePath": "Z:\\Users\\Software\\Git\\Send2Email\\SendEmail\\Scan2Email.csproj",
"expectedPackageFiles": [ "expectedPackageFiles": [
"C:\\Users\\Dylan Windows PC\\.nuget\\packages\\microsoft.aspnetcore.http.abstractions\\2.2.0\\microsoft.aspnetcore.http.abstractions.2.2.0.nupkg.sha512", "C:\\Users\\Dylan Windows PC\\.nuget\\packages\\microsoft.aspnetcore.http.abstractions\\2.2.0\\microsoft.aspnetcore.http.abstractions.2.2.0.nupkg.sha512",
"C:\\Users\\Dylan Windows PC\\.nuget\\packages\\microsoft.aspnetcore.http.features\\2.2.0\\microsoft.aspnetcore.http.features.2.2.0.nupkg.sha512", "C:\\Users\\Dylan Windows PC\\.nuget\\packages\\microsoft.aspnetcore.http.features\\2.2.0\\microsoft.aspnetcore.http.features.2.2.0.nupkg.sha512",