From ba537545e2c37a6d7b464a8a25cfc36d32056120 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Apr 2024 13:02:08 -0400 Subject: [PATCH] Fixed --- .gitattributes | 2 + .vs/Scan2Email/DesignTimeBuild/.dtbcache.v2 | Bin 0 -> 80102 bytes .vs/Scan2Email/v16/.suo | Bin 0 -> 58368 bytes LICENSE | 21 + README.md | 74 ++++ Scan2Email.sln | 25 ++ SendEmail/Form1.Designer.cs | 229 +++++++++++ SendEmail/Form1.cs | 59 +++ SendEmail/Form1.resx | 63 +++ SendEmail/Form2.Designer.cs | 89 ++++ SendEmail/Form2.cs | 61 +++ SendEmail/Form2.resx | 60 +++ SendEmail/Form3.Designer.cs | 382 ++++++++++++++++++ SendEmail/Form3.cs | 266 ++++++++++++ SendEmail/Form3.resx | 60 +++ SendEmail/Icon.ico | Bin 0 -> 2701 bytes SendEmail/Program.cs | 327 +++++++++++++++ .../PublishProfiles/FolderProfile.pubxml | 12 + .../PublishProfiles/FolderProfile.pubxml.user | 9 + SendEmail/Scan2Email.csproj | 18 + SendEmail/Scan2Email.csproj.user | 18 + SendEmail/cfg.json | 11 + 22 files changed, 1786 insertions(+) create mode 100644 .gitattributes create mode 100644 .vs/Scan2Email/DesignTimeBuild/.dtbcache.v2 create mode 100644 .vs/Scan2Email/v16/.suo create mode 100644 LICENSE create mode 100644 README.md create mode 100644 Scan2Email.sln create mode 100644 SendEmail/Form1.Designer.cs create mode 100644 SendEmail/Form1.cs create mode 100644 SendEmail/Form1.resx create mode 100644 SendEmail/Form2.Designer.cs create mode 100644 SendEmail/Form2.cs create mode 100644 SendEmail/Form2.resx create mode 100644 SendEmail/Form3.Designer.cs create mode 100644 SendEmail/Form3.cs create mode 100644 SendEmail/Form3.resx create mode 100644 SendEmail/Icon.ico create mode 100644 SendEmail/Program.cs create mode 100644 SendEmail/Properties/PublishProfiles/FolderProfile.pubxml create mode 100644 SendEmail/Properties/PublishProfiles/FolderProfile.pubxml.user create mode 100644 SendEmail/Scan2Email.csproj create mode 100644 SendEmail/Scan2Email.csproj.user create mode 100644 SendEmail/cfg.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.vs/Scan2Email/DesignTimeBuild/.dtbcache.v2 b/.vs/Scan2Email/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000000000000000000000000000000000000..48e0b667d51675a7edace2523642e63f8dfcec16 GIT binary patch literal 80102 zcmd5_3t$|@dEPZIgE3$T0g@7o2qDz?Bw3bU)FncaZN-)?TQ=q)|DHT$r5W>_h@Fc zYt+sx$#h$bx|S>(TiUT`iM_~Lw$$!i+F>oqbasqpy3$(KS*n+okeIW-4ptM^-zPHPz9PVLPAc&sk2E zaf^JGbE8gvL?}9vw=3yF$+n8cu2kp9aN5dqc&b#*SDc)kF676Y@zh1-Lf$xW-@!-M zOJyA2>`#n?_&d+7|D)EZVytS>dq#R!j35ohOIB|FDkp0rt_u}J+ekSxG18stNGzukOpn?AjN`W){PR(Tnz< zSu)wIabTrXwT&5mEmYQ|Upqp{Sk!-*?>7!i(I+#^SBt(Ho5zA|z)inX5+D6WuC ziNJGUBOG{Tw%gSDPa7xg=i|mHy@hNRR&q;ma{<=V?%iRhCkFB`YkhXv8P9Kqy)jPN zWS0xsU3O2oZ0AO^Q=9BD8|tO)vI5!>6knFfqLtPP;#Mc0DNNEoov0Lwsh(mng%^&% z)}=Z|O5k++*OSI~%Fd{hMFg{4bkGr)laRVf8V40J=56TEsq-a2;t`+KM!scUCC@jJDmw|n; zdxv*er6N;iIQY~TJ#_vZ?dTfo9$Pxr*_r9?u(~Yc*6^uh@2=Q+YJSQo-khkGESg*O zoJ-4OXP3;nN~6S=zTbZl8e?de$QRXR;qo;9$d3^&Mx@L~x8?nrC7WXjMAQ-@_uJ6e1#&ziCN)+#M-CGIkN&H?(-BoILGQ))`9L z=h#mbuM~y8+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Xf+3&HHzt7rp)THO0S^2|@N352YeR;mHPQ3J5pDUK{~qaBxjORJAc)w|I6+z`g{8H ze|e5xJwLV!D=KxUjaVzY;TiD@@7{{|>aUg&qG@q0nR=hz=`lR%j^``XJ0IJ_8>g>qg!ov!C+6aq zva!Oiw?9qMSAnHXaVBjMnO%q`xWZSzlG=?Fc*R~}MY%n{wgo?{VD0jjSVf+8Mq{>~ z3^fVb?ih1>gGg7S1Xrzs`uio+6kkZv5X$Kcp$&AqwV%u zn}|w_tc>`pXR)QRBdEtK4es46jj5gOm7ca&kV+DE6{VLfavdF9gH8Em-5uS+BI`?T z>n*oXqZfDSa}3#vGs#%XB|Cxk2j>g(`&b^ePf;TGZb-H zl27+PfPUC^-2l5UDqu0}dtvi8)_vG0zZUO~$7R`D@O%oo9DncfJ@8Z?BHWi?{~o~m zSFwqH7wk$*nZ=U zQQTEN+d_+OPl=Rcrb~27pd_Ih+qK`Cj9WJ^ZxgJ5BvA(iEe&O4J^g4`J5~Rqy+3(} zuA!Jz^*@aDQqpn@g34eD1^e)iwg?UKb}kpf@wIOiBg!xFh4Jynm-X{KpUoVx`TC4? z?$2G9+*zA?`_(GaqSff~HtFeG{9HOOX8(J~%3@bLHn hQt{3ey+7{0=BaPC_HG>a+(PC~%ml)=n&as3{|{Nwb7KGi literal 0 HcmV?d00001 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..09146b4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Dylan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4d92cd9 --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +# Send2Email +A simple application to send files of specified filetypes in the Pictures folder to a specified email address. +# Configuration +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. + +//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 +* You'll need to connect to an SMTP Server host to send email. +* Default: smtp.google.com + +##### SMTP_Port +* You'll need to connect to an SMTP Server port that is accepting traffic. +* The most common port for SMTP is 587, but if you're connecting to an older SMTP server it may be port 25, and if you're connecting to an SMTPS server that uses SSL it might be set to 465. +* Default: 587 + +##### SMTP_User +* This is the email address that you'll be logging into to send emails from. +* Default: N/A + +##### SMTP_Pass +* 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. +* 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. +* Default: N/A + +##### 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. +* Default: Same as SMTP_User + +##### Mail_Subject +* This is what will show in the Subject line of the email. +* Default: "Mail Subject Text" + +##### Mail_Body +* This is what will show in the Body line of the email. +* Default: "Mail Body Text" + +##### Mail_Delivery +* This is the message that will pop up on screen once you have send the email. +* The end of this message will append a blank space and the {destination_email} +* You will not need to add a space or the destination email variable to your string. +* Default: "Mail Delivery Text" + +##### File_Extensions +* This is what determines what types of files to send in the email. +* Comma separated list +* You do not need to include a period before the filetype +* Default: "jpg, jpeg, png, gif, bmp, tif, pdf" + +The final file should look something like this. +```sh +{ + "SMTP_Host": "smtp.gmail.com", + "SMTP_Port": 587, + "SMTP_User": "email@company.com", + "SMTP_Pass": "smtp_password", + "Mail_From": "email@company.com", + "Mail_Subject": "Mail Subject Text", + "Mail_Body": "Mail Body Text", + "Mail_Delivery": "Mail Delivery Text", + "File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf" +} +``` + +# Usage +Onve you've set up the cfg.json file Send2Email is a simple program, to use it you'll simply run it, and enter in an email address. Click send and it will attempt to attach each file in the User's Pictures directory as an attachment to that email, provided they are of the proper filetypes. + + + + + diff --git a/Scan2Email.sln b/Scan2Email.sln new file mode 100644 index 0000000..bb2187b --- /dev/null +++ b/Scan2Email.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30611.23 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Scan2Email", "SendEmail\Scan2Email.csproj", "{1A02CCC7-F2E8-46BE-8329-FA552F5EEBFF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A02CCC7-F2E8-46BE-8329-FA552F5EEBFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A02CCC7-F2E8-46BE-8329-FA552F5EEBFF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A02CCC7-F2E8-46BE-8329-FA552F5EEBFF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A02CCC7-F2E8-46BE-8329-FA552F5EEBFF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {455A9DCB-2147-480D-B708-69073E1ABF7D} + EndGlobalSection +EndGlobal diff --git a/SendEmail/Form1.Designer.cs b/SendEmail/Form1.Designer.cs new file mode 100644 index 0000000..a6af068 --- /dev/null +++ b/SendEmail/Form1.Designer.cs @@ -0,0 +1,229 @@ +using System; + +namespace SendEmail +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SendBtn = new System.Windows.Forms.Button(); + this.EmailLabel = new System.Windows.Forms.Label(); + this.EmailInput = new System.Windows.Forms.TextBox(); + this.FileComboBox = new System.Windows.Forms.ToolStripComboBox(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = 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.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); + this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // SendBtn + // + this.SendBtn.Location = new System.Drawing.Point(291, 48); + this.SendBtn.Name = "SendBtn"; + this.SendBtn.Size = new System.Drawing.Size(75, 23); + this.SendBtn.TabIndex = 0; + this.SendBtn.Text = "Send"; + this.SendBtn.UseVisualStyleBackColor = true; + this.SendBtn.Click += new System.EventHandler(this.SendClick); + // + // EmailLabel + // + this.EmailLabel.AutoSize = true; + this.EmailLabel.Location = new System.Drawing.Point(12, 31); + this.EmailLabel.Name = "EmailLabel"; + this.EmailLabel.Size = new System.Drawing.Size(81, 15); + this.EmailLabel.TabIndex = 1; + this.EmailLabel.Text = "Email Address"; + // + // EmailInput + // + this.EmailInput.Location = new System.Drawing.Point(12, 49); + this.EmailInput.Name = "EmailInput"; + this.EmailInput.Size = new System.Drawing.Size(273, 23); + this.EmailInput.TabIndex = 2; + this.EmailInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CheckEnter); + // + // FileComboBox + // + this.FileComboBox.AutoSize = false; + this.FileComboBox.Name = "FileComboBox"; + this.FileComboBox.Size = new System.Drawing.Size(121, 23); + this.FileComboBox.Text = "File"; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.editToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; + this.menuStrip1.Size = new System.Drawing.Size(384, 24); + this.menuStrip1.Stretch = false; + this.menuStrip1.TabIndex = 3; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(92, 22); + this.exitToolStripMenuItem.Text = "Exit"; + 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 + // + this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.selectAllToolStripMenuItem.Text = "Select &All"; + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(141, 6); + // + // pasteToolStripMenuItem + // + this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; + this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.pasteToolStripMenuItem.Text = "&Paste"; + // + // copyToolStripMenuItem + // + this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; + this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.copyToolStripMenuItem.Text = "&Copy"; + // + // cutToolStripMenuItem + // + this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta; + this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; + this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.cutToolStripMenuItem.Text = "Cu&t"; + // + // toolStripSeparator3 + // + this.toolStripSeparator3.Name = "toolStripSeparator3"; + this.toolStripSeparator3.Size = new System.Drawing.Size(141, 6); + // + // redoToolStripMenuItem + // + this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; + this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); + this.redoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.redoToolStripMenuItem.Text = "&Redo"; + // + // undoToolStripMenuItem + // + this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; + this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); + this.undoToolStripMenuItem.Size = new System.Drawing.Size(144, 22); + this.undoToolStripMenuItem.Text = "&Undo"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScroll = true; + this.AutoSize = true; + this.ClientSize = new System.Drawing.Size(384, 84); + this.Controls.Add(this.EmailInput); + this.Controls.Add(this.EmailLabel); + this.Controls.Add(this.SendBtn); + this.Controls.Add(this.menuStrip1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MainMenuStrip = this.menuStrip1; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form1"; + this.Text = " Send2Email"; + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button SendBtn; + private System.Windows.Forms.Label EmailLabel; + private System.Windows.Forms.TextBox EmailInput; + private System.Windows.Forms.ToolStripComboBox FileComboBox; + 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.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; + private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem; + } +} + diff --git a/SendEmail/Form1.cs b/SendEmail/Form1.cs new file mode 100644 index 0000000..af14da4 --- /dev/null +++ b/SendEmail/Form1.cs @@ -0,0 +1,59 @@ +using System; +using System.Windows.Forms; + + +namespace SendEmail +{ + public partial class Form1 : Form + { + /* + * Form1 is the main window for Send2Email + */ + #region UI + public Form1() //Autogenerated Code Block + { + InitializeComponent(); + } + + private void ExitClick(object sender, EventArgs e) + { + //Exit the application + Application.Exit(); + } + + private void ConfigClick(object sender, EventArgs e) + { + this.Hide(); //Hide Form1 + var form2 = new Form2(); //Create Form 2 + form2.Closed += (s, args) => this.Show(); //Attach this.Show() to the Form2.Close() eventhandler, which will show Form1 when Form2 closes. + form2.Show(); //Show Form2 + } + + private void SendClick(object sender, EventArgs e) + { + string email = EmailInput.Text; //Get Email from Text Input + //Checks if email is valid, this does not check if the email address DOES exist, just if it CAN exist + if (Program.IsValidEmail(email)) //If email is valid + { + Program.Send(email); //Sends valid email to Send() function from within Program.cs + } + else //If the email is not valid + { + //Error Message for invalid email + MessageBox.Show(email + " is not a valid email address.\r\nPlease enter a valid email address."); + } + + } + + #endregion + + //Check if enter key is pressed in email address input + private void CheckEnter(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Return) //If enter key pressed run the SendClick() function + { + SendClick(sender, e); + } + } + } +} diff --git a/SendEmail/Form1.resx b/SendEmail/Form1.resx new file mode 100644 index 0000000..938108a --- /dev/null +++ b/SendEmail/Form1.resx @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/SendEmail/Form2.Designer.cs b/SendEmail/Form2.Designer.cs new file mode 100644 index 0000000..b67b76a --- /dev/null +++ b/SendEmail/Form2.Designer.cs @@ -0,0 +1,89 @@ + +namespace SendEmail +{ + partial class Form2 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.passButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(75, 6); + this.textBox1.Name = "textBox1"; + this.textBox1.PasswordChar = '●'; + this.textBox1.Size = new System.Drawing.Size(216, 23); + this.textBox1.TabIndex = 0; + this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.CheckEnter); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(57, 15); + this.label1.TabIndex = 1; + this.label1.Text = "Password"; + // + // passButton + // + this.passButton.Location = new System.Drawing.Point(297, 5); + this.passButton.Name = "passButton"; + this.passButton.Size = new System.Drawing.Size(75, 23); + this.passButton.TabIndex = 2; + this.passButton.Text = "Submit"; + this.passButton.UseVisualStyleBackColor = true; + this.passButton.Click += new System.EventHandler(this.PassButtonClick); + // + // Form2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(384, 39); + this.Controls.Add(this.passButton); + this.Controls.Add(this.label1); + this.Controls.Add(this.textBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form2"; + this.Text = "Form2"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button passButton; + } +} \ No newline at end of file diff --git a/SendEmail/Form2.cs b/SendEmail/Form2.cs new file mode 100644 index 0000000..542d769 --- /dev/null +++ b/SendEmail/Form2.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace SendEmail +{ + public partial class Form2 : Form + { + /* + * Form2 is only the password prompt to enter the configuration menu + */ + + //Global Variables + int wrongCount = 0; //Counts how many times the password is entered incorrectly + const int LIMIT = 5; //The amount of times a password can be tried before exiting + + public Form2() //Autogenerated Code Block + { + InitializeComponent(); + } + + //Checks the password entered + private void PassButtonClick(object sender, EventArgs e) + { + string input = textBox1.Text; + if (input == Program.smtp_pass) //If password is correct + { + this.Hide(); //Hide Form2 + var form3 = new Form3(); //Create Form3 + form3.Closed += (s, args) => this.Close(); //Attach this.Show() to the Form3.Close() eventhandler, which will show Form2 when Form3 closes. + form3.Show(); //Show Form3 + } + else + { + wrongCount++; //Each time this code is reached the wrong counter increases by 1 + if(wrongCount == LIMIT) //If we've reached the limit + { + Application.Exit(); //Exit the application + } + else //If we haven't reached the limit + { + //Inform user the number of password attempts remaining. + MessageBox.Show("Incorrect password. " + (LIMIT - wrongCount).ToString() + " attempts remaining."); + } + } + } + + //Check if enter key is pressed in the password text box + private void CheckEnter(object sender, KeyEventArgs e) + { + if(e.KeyCode == Keys.Return) + { + PassButtonClick(sender, e); + } + } + } +} diff --git a/SendEmail/Form2.resx b/SendEmail/Form2.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SendEmail/Form2.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SendEmail/Form3.Designer.cs b/SendEmail/Form3.Designer.cs new file mode 100644 index 0000000..7eeff88 --- /dev/null +++ b/SendEmail/Form3.Designer.cs @@ -0,0 +1,382 @@ + +namespace SendEmail +{ + partial class Form3 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.hostTB = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.portTB = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.emailTB = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.passwordTB = new System.Windows.Forms.TextBox(); + this.panel1 = new System.Windows.Forms.Panel(); + this.label6 = new System.Windows.Forms.Label(); + this.panel2 = new System.Windows.Forms.Panel(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.fromTB = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.subjectTB = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.bodyTB = new System.Windows.Forms.TextBox(); + this.deliveryTB = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.panel3 = new System.Windows.Forms.Panel(); + this.label15 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.extensionsTB = new System.Windows.Forms.TextBox(); + this.saveBtn = new System.Windows.Forms.Button(); + this.panel4 = new System.Windows.Forms.Panel(); + this.infoBox = new System.Windows.Forms.TextBox(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + this.panel3.SuspendLayout(); + this.panel4.SuspendLayout(); + this.SuspendLayout(); + // + // hostTB + // + this.hostTB.Location = new System.Drawing.Point(71, 32); + this.hostTB.Name = "hostTB"; + this.hostTB.Size = new System.Drawing.Size(431, 23); + this.hostTB.TabIndex = 0; + this.hostTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(26, 35); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(32, 15); + this.label1.TabIndex = 1; + this.label1.Text = "Host"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(29, 64); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(29, 15); + this.label2.TabIndex = 3; + this.label2.Text = "Port"; + // + // portTB + // + this.portTB.Location = new System.Drawing.Point(71, 61); + this.portTB.Name = "portTB"; + this.portTB.Size = new System.Drawing.Size(431, 23); + this.portTB.TabIndex = 2; + this.portTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(22, 93); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(36, 15); + this.label3.TabIndex = 5; + this.label3.Text = "Email"; + // + // emailTB + // + this.emailTB.Location = new System.Drawing.Point(71, 90); + this.emailTB.Name = "emailTB"; + this.emailTB.Size = new System.Drawing.Size(431, 23); + this.emailTB.TabIndex = 4; + this.emailTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(1, 122); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(57, 15); + this.label4.TabIndex = 7; + this.label4.Text = "Password"; + // + // passwordTB + // + this.passwordTB.Location = new System.Drawing.Point(71, 119); + this.passwordTB.Name = "passwordTB"; + this.passwordTB.Size = new System.Drawing.Size(431, 23); + this.passwordTB.TabIndex = 6; + this.passwordTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.SystemColors.ControlLight; + this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel1.Controls.Add(this.label6); + this.panel1.Controls.Add(this.label4); + this.panel1.Controls.Add(this.hostTB); + this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.portTB); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.emailTB); + this.panel1.Controls.Add(this.passwordTB); + this.panel1.Controls.Add(this.label3); + this.panel1.Location = new System.Drawing.Point(12, 13); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(521, 155); + this.panel1.TabIndex = 11; + // + // label6 + // + this.label6.AutoSize = true; + this.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); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(132, 25); + this.label6.TabIndex = 0; + this.label6.Text = "SMTP Settings"; + // + // panel2 + // + this.panel2.BackColor = System.Drawing.SystemColors.ControlLight; + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.label7); + this.panel2.Controls.Add(this.label8); + this.panel2.Controls.Add(this.fromTB); + this.panel2.Controls.Add(this.label9); + this.panel2.Controls.Add(this.subjectTB); + this.panel2.Controls.Add(this.label10); + this.panel2.Controls.Add(this.bodyTB); + this.panel2.Controls.Add(this.deliveryTB); + this.panel2.Controls.Add(this.label11); + this.panel2.Location = new System.Drawing.Point(12, 174); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(521, 155); + this.panel2.TabIndex = 12; + // + // label7 + // + this.label7.AutoSize = true; + this.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); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(121, 25); + this.label7.TabIndex = 0; + this.label7.Text = "Mail Settings"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(9, 122); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(49, 15); + this.label8.TabIndex = 7; + this.label8.Text = "Delivery"; + // + // fromTB + // + this.fromTB.Location = new System.Drawing.Point(71, 32); + this.fromTB.Name = "fromTB"; + this.fromTB.Size = new System.Drawing.Size(431, 23); + this.fromTB.TabIndex = 0; + this.fromTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(23, 35); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(35, 15); + this.label9.TabIndex = 1; + this.label9.Text = "From"; + // + // subjectTB + // + this.subjectTB.Location = new System.Drawing.Point(71, 61); + this.subjectTB.Name = "subjectTB"; + this.subjectTB.Size = new System.Drawing.Size(431, 23); + this.subjectTB.TabIndex = 2; + this.subjectTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(12, 64); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(46, 15); + this.label10.TabIndex = 3; + this.label10.Text = "Subject"; + // + // bodyTB + // + this.bodyTB.Location = new System.Drawing.Point(71, 90); + this.bodyTB.Name = "bodyTB"; + this.bodyTB.Size = new System.Drawing.Size(431, 23); + this.bodyTB.TabIndex = 4; + this.bodyTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // deliveryTB + // + this.deliveryTB.Location = new System.Drawing.Point(71, 119); + this.deliveryTB.Name = "deliveryTB"; + this.deliveryTB.Size = new System.Drawing.Size(431, 23); + this.deliveryTB.TabIndex = 6; + this.deliveryTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(24, 93); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(34, 15); + this.label11.TabIndex = 5; + this.label11.Text = "Body"; + // + // panel3 + // + this.panel3.BackColor = System.Drawing.SystemColors.ControlLight; + this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel3.Controls.Add(this.label15); + this.panel3.Controls.Add(this.label5); + this.panel3.Controls.Add(this.extensionsTB); + this.panel3.Location = new System.Drawing.Point(12, 335); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(521, 155); + this.panel3.TabIndex = 13; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(3, 35); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(62, 15); + this.label15.TabIndex = 7; + this.label15.Text = "Extensions"; + // + // label5 + // + this.label5.AutoSize = true; + this.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); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(150, 25); + this.label5.TabIndex = 0; + this.label5.Text = "General Settings"; + // + // extensionsTB + // + this.extensionsTB.Location = new System.Drawing.Point(71, 32); + this.extensionsTB.Name = "extensionsTB"; + this.extensionsTB.Size = new System.Drawing.Size(431, 23); + this.extensionsTB.TabIndex = 2; + this.extensionsTB.MouseEnter += new System.EventHandler(this.HoverInfo); + // + // saveBtn + // + this.saveBtn.Location = new System.Drawing.Point(12, 497); + this.saveBtn.Name = "saveBtn"; + this.saveBtn.Size = new System.Drawing.Size(521, 23); + this.saveBtn.TabIndex = 14; + this.saveBtn.Text = "Save"; + this.saveBtn.UseVisualStyleBackColor = true; + this.saveBtn.Click += new System.EventHandler(this.SaveConfig); + // + // panel4 + // + this.panel4.BackColor = System.Drawing.SystemColors.ControlLight; + this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel4.Controls.Add(this.infoBox); + this.panel4.Location = new System.Drawing.Point(540, 13); + this.panel4.Name = "panel4"; + this.panel4.Size = new System.Drawing.Size(171, 507); + this.panel4.TabIndex = 15; + // + // infoBox + // + this.infoBox.Location = new System.Drawing.Point(4, 5); + this.infoBox.Multiline = true; + this.infoBox.Name = "infoBox"; + this.infoBox.ReadOnly = true; + this.infoBox.Size = new System.Drawing.Size(162, 497); + this.infoBox.TabIndex = 0; + // + // Form3 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(723, 546); + this.Controls.Add(this.panel4); + this.Controls.Add(this.saveBtn); + this.Controls.Add(this.panel3); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form3"; + this.Text = "Form3"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.panel2.ResumeLayout(false); + this.panel2.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + this.panel4.ResumeLayout(false); + this.panel4.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TextBox hostTB; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox portTB; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox emailTB; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox passwordTB; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox fromTB; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox subjectTB; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox bodyTB; + private System.Windows.Forms.TextBox deliveryTB; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox extensionsTB; + private System.Windows.Forms.Button saveBtn; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Panel panel4; + private System.Windows.Forms.TextBox infoBox; + } +} \ No newline at end of file diff --git a/SendEmail/Form3.cs b/SendEmail/Form3.cs new file mode 100644 index 0000000..d1e52e5 --- /dev/null +++ b/SendEmail/Form3.cs @@ -0,0 +1,266 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using Newtonsoft.Json.Linq; +using System.Linq; +using System.Security.Cryptography; + +namespace SendEmail +{ + public partial class Form3 : Form + { + /* + * Form3 is the configuration window for Send2Email + */ + + #region UI + + //Default info in the info textbox + string defaultInfo = "Helpful information about each section will display here when you hover over a textbox with your mouse."; + + public Form3() //Automatically generated codeblock + { + InitializeComponent(); + SetInfoBox(defaultInfo); + FillData(); + } + + //This will set the info textbox's contents when you hover over an input field + private void SetInfoBox(string input) + { + infoBox.Text = input; + } + + //Fill the input fields with the data from the config file + public void FillData() + { + hostTB.Text = Program.smtp_host; + portTB.Text = Program.smtp_port.ToString(); + emailTB.Text = Program.smtp_user; + passwordTB.Text = Program.smtp_pass; + + fromTB.Text = Program.mail_from; + subjectTB.Text = Program.mail_subject; + bodyTB.Text = Program.mail_body; + deliveryTB.Text = Program.mail_delivery; + + extensionsTB.Text = Program.file_extensions; + } + + //Detects when mouse hovers over an input field and calls SetInfoBox() with updated info text + private void HoverInfo(object sender, EventArgs e) + { + 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 output; + + switch (holdName) //Switch through the possible input fields and sets the output to the correct values + { + case "hostTB": + output = "SMTP Host: SMTP Host. At the time of creation, we utalize Google's SMTP server located at smtp.google.com"; + break; + case "portTB": + output = "SMTP Port: SMTP Port"; + break; + case "emailTB": + output = "SMTP Email: The Email Address that is signing into the SMTP server."; + break; + case "passwordTB": + output = "SMTP Password: The password to sign into the SMTP server."; + break; + case "fromTB": + output = "Mail From: This is the email that will be listed in the 'from' section of the recipients email"; + break; + case "subjectTB": + output = "Mail Subject: This is what will be put into the subject line of the email"; + break; + case "bodyTB": + output = "Mail Body: This is what will be put into the body of the email"; + break; + case "deliveryTB": + output = "Mail Delivery: is the message that will appear on screen once the user has successfully emailed themselves"; + break; + 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"; + break; + default: + output = defaultInfo; + break; + } + + SetInfoBox(output); //Send the output text to the info textbox + } + + #endregion + + #region Save/Load Configuration + + //Save the configuration data, will overwrite existing settings + private void SaveConfig(object sender, EventArgs e) + { + string cfg_host = hostTB.Text; + string string_cfg_port = portTB.Text; + string cfg_user = emailTB.Text; + string cfg_pass = passwordTB.Text; + + string cfg_from = fromTB.Text; + string cfg_subject = subjectTB.Text; + string cfg_body = bodyTB.Text; + string cfg_delivery = deliveryTB.Text; + + string cfg_extensions = extensionsTB.Text; + + int cfg_port = Int32.Parse(string_cfg_port); + + //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); + + //Serialize the JSON data so it can be written to a text file + string[] json = { JsonConvert.SerializeObject(cfg, Formatting.Indented) }; + + //Write Config file to Program.appPath (default is Appdata/Local/Send2Email) + WriteFile(json, Program.configName, Program.configFileExt); + } + + + public static bool LoadConfig() //Boolean method, returns true or false to whatever called LoadConfig + { + //Config filepath + string cfg = Program.appPath + "/" + Program.configFileName; + + //Check if config file exists + bool cExist = File.Exists(cfg); + + if (!cExist) //If a config doesn't exist + { + return false; //Return false for LoadConfig boolean + } + else //Config file does exist + { + //Create an array to store the configuration file line by line + string[] cfgFile = ReadFile("cfg", "json"); + string cfgData = ConvertStringArray(cfgFile); + + //Get the first line of our configuration + + Config config = JsonConvert.DeserializeObject(cfgData); + + Program.smtp_host = config.SMTP_Host; + Program.smtp_port = config.SMTP_Port; + Program.smtp_user = config.SMTP_User; + Program.smtp_pass = config.SMTP_Pass; + + Program.mail_from = config.Mail_From; + Program.mail_body = config.Mail_Body; + Program.mail_subject = config.Mail_Subject; + Program.mail_delivery = config.Mail_Delivery; + + Program.file_extensions = config.File_Extensions; + + return true; + } + } + + #endregion + + #region Read/Write Files + + // Create a string array with the lines of text + public static void WriteFile(string[] data, string fileName, string fileExtension) + { + + string temp = ""; + string file = fileName + "." + fileExtension; + + // Write the string array to a new file named fileName + "." + fileExtension + using (StreamWriter outputFile = new StreamWriter(Path.Combine(Program.appPath, file))) + { + foreach (string line in data) + { + temp = line; + } + outputFile.WriteLine(temp); + } + } + + + public static string[] ReadFile(string fileName, string fileExtension) + { + string temp = ""; + string file = fileName + "." + fileExtension; + + string[] lines = System.IO.File.ReadAllLines(Path.Combine(Program.appPath, file)); + string[] output = new string[lines.Length]; + + for (int i = 0; i < lines.Length; i++) + { + temp = lines[i]; + output[i] = temp; + } + + return output; + } + + /* Takes a multi-line file and turns it into a single-line string + * This is really only here because the JSON files are pretty-printed + * for human readability, but it's much easier to work with the JSON + * data as a single string rather than an array of string data*/ + public static string ConvertStringArray(string[] input) + { + string output = ""; + foreach (string line in input) //Loop through input and append it to the end of output + { + output += line; + } + + return output; + } + + #region JSON Config + /* Sources + * https://www.newtonsoft.com/json/help/html/SerializingJSON.htm + * https://www.newtonsoft.com/json/help/html/SerializeWithJsonSerializerToFile.htm + */ + public class Config + { + public string SMTP_Host { get; set; } + public int SMTP_Port { get; set; } + public string SMTP_User { get; set; } + public string SMTP_Pass { get; set; } + + public string Mail_From { get; set; } + public string Mail_Subject { get; set; } + public string Mail_Body { get; set; } + public string Mail_Delivery { get; set; } + + public string File_Extensions { get; set; } + + 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) + { + SMTP_Host = smtp_host; + SMTP_Port = smtp_port; + SMTP_User = smtp_user; + SMTP_Pass = smtp_pass; + + Mail_From = mail_from; + Mail_Subject = mail_subject; + Mail_Body = mail_body; + Mail_Delivery = mail_delivery; + + File_Extensions = file_extensions; + } + } + + #endregion + + #endregion + + + } +} diff --git a/SendEmail/Form3.resx b/SendEmail/Form3.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/SendEmail/Form3.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SendEmail/Icon.ico b/SendEmail/Icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5462eee45a34c418cac830c20c16b54711847230 GIT binary patch literal 2701 zcmV;83Uc)T0096205C8B0096X0Cx%i02TlM0EtjeM-2)Z3IG5A4M|8uQUCw|FaQ7m zFbDmy=QTVdJ%EG7$@u&g-Ax&5Fo-PK8t#TygIc$h#w*zNkrnqhYvRsBrky>sWzRjO1fEdkq2^i2Ft5c|IKItjjy*oN5A0qzG7gviLq z#x-l!)NI_iQBI&XJ(Ij#39mS&BYzYtHk<+;2LyjzcpOdvm7-HCLfsvVju_^AHzLXt zjPFSzv>lAGim@ugE?~^UUmNCSH<|s&dhvO=!EAPU?Cs$8I?d02lIG3-{y(4%-aQDG zXa5!K@?+*;BrN-|rPl;R#;p+EyCjET94#(`v`3$`Lw3m*Q2Ns|5K4e4_b?cr%x;Io zUq%~yLqHWdUGS^l3K#1w@VjrdjCfkL8NO|{!=;+44g_q2nxrdG{NYzn@}pG5SCBvU zU{?iHg@bs1#9t)hzMTDWlF;h#LXN@;)Bi08tJ?>+6gD_nTG62Zm)ZhuofSML2UyEA zQ274wt_rY77tzbitwOy`7B6tON>2YDJhWXr5fz^(FqU~?IvLX`u0s|;Ko8jl?kv`Z2+hGqPTtLV*3&b_>2jlm>64197GXLky~^}v%UaP!c~tMGe&py>Q$xB z=ktsjHA=$;eQ!9 zKvC>*&}CLI0p_BQz-z0+E%Z;Y*8CNOia+?b5XGd}*REYt5|@D0C=t2(SA$-XeF&G> z!5beRFVpFCtsoi~FgZR^s4%$TQiA|Ce1T~doE{%EnB8Eo%0s@yr9b-@G;GWPO?ojD zOh|^xWf@?+*8rx+B;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Eq#Qk+@6PQcavVQI0hYJL2gVfejlrG-9RbdQ;@N5eK|PHS%9Zh$C?o1yIQ% z$q1}juvWL9IdeuzrSh95&yBdGrKL%UTTqQf+}S^|{Xd_K8#hkAdGlt~mMvQ}Zxe_U zaSI@C5VhBdz+ybIk&NCh;#&96OC^v8byxNIO+cZ&Ka output = new List(); //Holds the output + + try + { + extensions = file_extensions.Split(","); + for (int e = 0; e < extensions.Length; e++) + { + extensions[e] = extensions[e].Trim(' '); //Remove any whitespace + } + } + catch (Exception ex) + { + MessageBox.Show("Error parsing extension " + ex + "\r\nUsing default values.\r\njpg, jpeg, png, gif, bmp, tif, pdf"); + string[] fill = { "jpg", "jpeg", "tif", "gif", "bmp", "pdf" }; + extensions = fill; + } + + string[] files = Directory.GetFiles(picPath); //Get array of all files in Pictures folder + + for (int i = 0; i < files.Length; i++) //Loop through all files + { + string file = files[i]; //current file + for(int j = 0; j < extensions.Length; j++) //Loop through all extensions for each file + { + string footer = file.Substring(file.Length - extensions[j].Length); + //If the file ends with an extension from our extensions array + if (footer.ToString() == extensions[j].ToString()) + { + output.Add(files[i]); //Add it to the output + } + } + + } + + return output.ToArray(); //Return a list of all attachments + } + + #endregion + + #region Send Email + + public static void Send(string sendTo) //Send email function. This is where most of the work starts + { + string[] getAttachments = Attachments(); //Gets all valid attachment files in Pictures folder + + try + { + System.Net.Mail.Attachment attachment; //Create attachment variable + MailMessage mail = new MailMessage(); //Create mail variable + SmtpClient SmtpServer = new SmtpClient(smtp_host); //Create SmtpClient + + //Load smtp/email settings from Configuration file + SmtpServer.Port = smtp_port; + mail.From = new MailAddress(mail_from); + mail.Subject = mail_subject; + mail.Body = mail_body; + + mail.To.Add(sendTo.ToString()); //Get sendTo email from user input + + for(int i = 0; i < getAttachments.Length; i++) //Loop through each attachment + { + attachment = new System.Net.Mail.Attachment(getAttachments[i]); //Set the attachment variable + 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.EnableSsl = true; //Use SSL Encryption + + SmtpServer.Send(mail); //Send our mail variable + MessageBox.Show(mail_delivery + sendTo); //Popup informs user where the email was sent + } + catch (Exception ex) //If the Try fails the catch will output this error message. + { + MessageBox.Show("A critical error has occured please contact IT \r\n" + ex.ToString()); + } + } + + #endregion + + #endregion + } +} + + +#region [ARCHIVE] +/* This code is commented out, but it might be + * useful if we ever need to work on the software + * again in the future, so I've kept it archived. */ + +#region [ARCHIVE] Encryption, Decryption +/* +//Methods used to encrypt and decrypt a string +//Source https://www.delftstack.com/howto/csharp/encrypt-and-decrypt-a-string-in-csharp/ + +public static string Encrypt(string input) +{ + try + { + string textToEncrypt = input; + string ToReturn = ""; + byte[] secretkeyByte = { }; + secretkeyByte = System.Text.Encoding.UTF8.GetBytes(key_secret); + byte[] publickeybyte = { }; + publickeybyte = System.Text.Encoding.UTF8.GetBytes(key_public); + MemoryStream ms = null; + CryptoStream cs = null; + byte[] inputbyteArray = System.Text.Encoding.UTF8.GetBytes(textToEncrypt); + using (DESCryptoServiceProvider des = new DESCryptoServiceProvider()) + { + ms = new MemoryStream(); + cs = new CryptoStream(ms, des.CreateEncryptor(publickeybyte, secretkeyByte), CryptoStreamMode.Write); + cs.Write(inputbyteArray, 0, inputbyteArray.Length); + cs.FlushFinalBlock(); + ToReturn = Convert.ToBase64String(ms.ToArray()); + } + return ToReturn; + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex.InnerException); + } +} + +static string Decrypt(string input) +{ + try + { + string textToDecrypt = input; + string ToReturn = ""; + byte[] privatekeyByte = { }; + privatekeyByte = System.Text.Encoding.UTF8.GetBytes(key_secret); + byte[] publickeybyte = { }; + publickeybyte = System.Text.Encoding.UTF8.GetBytes(key_public); + MemoryStream ms = null; + CryptoStream cs = null; + byte[] inputbyteArray = new byte[textToDecrypt.Replace(" ", "+").Length]; + inputbyteArray = Convert.FromBase64String(textToDecrypt.Replace(" ", "+")); + using (DESCryptoServiceProvider des = new DESCryptoServiceProvider()) + { + ms = new MemoryStream(); + cs = new CryptoStream(ms, des.CreateDecryptor(publickeybyte, privatekeyByte), CryptoStreamMode.Write); + cs.Write(inputbyteArray, 0, inputbyteArray.Length); + cs.FlushFinalBlock(); + Encoding encoding = Encoding.UTF8; + ToReturn = encoding.GetString(ms.ToArray()); + } + return ToReturn; + } + catch (Exception ae) + { + throw new Exception(ae.Message, ae.InnerException); + } +} +*/ +#endregion + +#region [ARCHIVE] Encrypt/Decrypt Files +/* +public static void WriteEncryptedFile(string[] data, string fileName, string fileExtension) +{ + + string temp = ""; + string file = fileName + "." + fileExtension; + + // Write the string array to a new file named "WriteLines.txt". + using (StreamWriter outputFile = new StreamWriter(Path.Combine(appPath, file))) + { + foreach (string line in data) + { + temp = Encrypt(line); + } + outputFile.WriteLine(temp); + } +} + +public static string[] ReadEncryptedFile(string fileName, string fileExtension) +{ + string temp = ""; + string file = fileName + "." + fileExtension; + + string[] lines = System.IO.File.ReadAllLines(Path.Combine(appPath, file)); + string[] output = new string[lines.Length]; + + for (int i = 0; i < lines.Length; i++) + { + temp = Decrypt(lines[i]); + output[i] = temp; + } + + return output; +} + +*/ +#endregion + +#region [ARCHIVE] Keygen +/* +//Used origonally do generate public and secret keys +public static string GenerateKey(int length) +{ + //Random + Random rand = new Random(); + const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + return new string(Enumerable.Repeat(chars, length).Select(s => s[rand.Next(s.Length)]).ToArray()); +} +*/ +#endregion + +#endregion \ No newline at end of file diff --git a/SendEmail/Properties/PublishProfiles/FolderProfile.pubxml b/SendEmail/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..ed3755a --- /dev/null +++ b/SendEmail/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,12 @@ + + + + + Release + Any CPU + bin\Release\netcoreapp3.1\publish\ + FileSystem + + \ No newline at end of file diff --git a/SendEmail/Properties/PublishProfiles/FolderProfile.pubxml.user b/SendEmail/Properties/PublishProfiles/FolderProfile.pubxml.user new file mode 100644 index 0000000..9399edf --- /dev/null +++ b/SendEmail/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -0,0 +1,9 @@ + + + + + True|2021-09-24T17:40:27.7262759Z;True|2021-09-24T10:57:38.6187319-04:00; + + \ No newline at end of file diff --git a/SendEmail/Scan2Email.csproj b/SendEmail/Scan2Email.csproj new file mode 100644 index 0000000..2ad854c --- /dev/null +++ b/SendEmail/Scan2Email.csproj @@ -0,0 +1,18 @@ + + + + WinExe + netcoreapp3.1 + true + 6daf7e52-c505-4d4e-9d5d-e220057a73ca + Icon.ico + + + + + + + + + + \ No newline at end of file diff --git a/SendEmail/Scan2Email.csproj.user b/SendEmail/Scan2Email.csproj.user new file mode 100644 index 0000000..0b9c102 --- /dev/null +++ b/SendEmail/Scan2Email.csproj.user @@ -0,0 +1,18 @@ + + + + true + <_LastSelectedProfileId>\\mcls-DC03\users\dylan\GitHub\SendEmail\SendEmail\Properties\PublishProfiles\FolderProfile.pubxml + + + + Form + + + Form + + + Form + + + \ No newline at end of file diff --git a/SendEmail/cfg.json b/SendEmail/cfg.json new file mode 100644 index 0000000..05f67a2 --- /dev/null +++ b/SendEmail/cfg.json @@ -0,0 +1,11 @@ +{ + "SMTP_Host": "smtp.gmail.com", + "SMTP_Port": 587, + "SMTP_User": "email@company.com", + "SMTP_Pass": "smtp_password", + "Mail_From": "email@company.com", + "Mail_Subject": "Mail Subject Text", + "Mail_Body": "Mail Body Text", + "Mail_Delivery": "Mail Delivery Text + {destination_email}", + "File_Extensions": "jpg, jpeg, png, gif, bmp, tif, pdf" +} \ No newline at end of file