diff --git a/.vs/DeskHubSharp/v15/.suo b/.vs/DeskHubSharp/v15/.suo index 4e48b19..767ffd8 100644 Binary files a/.vs/DeskHubSharp/v15/.suo and b/.vs/DeskHubSharp/v15/.suo differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide index 96bba70..1017f59 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm index d0ad1ab..780168d 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal index 954cda1..6354ba0 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal differ diff --git a/DeskHubSharp/BusinessLayer/EmailBLL.cs b/DeskHubSharp/BusinessLayer/EmailBLL.cs index 205bf6e..726a6a0 100644 --- a/DeskHubSharp/BusinessLayer/EmailBLL.cs +++ b/DeskHubSharp/BusinessLayer/EmailBLL.cs @@ -16,15 +16,15 @@ namespace DeskHubSharp // TODO: finish this class // TODO: debug feedback form - private string _to = "wjmiller2016@gmail.com"; - private string _from = "wjmiller2016@gmail.com"; private string _name; private string _message; + private string _emailText; - public EmailBLL(TextBox name, TextBox emailBody) + public EmailBLL(string name, string message, string emailText) { - _name = name.Text; - _message = emailBody.Text; + _name = name; + _message = message; + _emailText = emailText; } private bool IsValidated() @@ -55,24 +55,27 @@ namespace DeskHubSharp { try { + var email = new Email(); var err = new ErrorWindow(); var message = new MimeMessage(); - message.From.Add(new MailboxAddress($"{_name}", _from)); - message.To.Add(new MailboxAddress("Wyatt J. Miller", _to)); + + message.From.Add(new MailboxAddress($"{_name}", email.FromEmail)); + message.To.Add(new MailboxAddress("Wyatt J. Miller", email.ToEmail)); message.Subject = $"{_name} requires your attention!"; message.Body = new TextPart("plain") { - Text = _message + Text = _message + _emailText }; using (var client = new SmtpClient()) { client.Connect("smtp.gmail.com", 465, SecureSocketOptions.SslOnConnect); // change credentials - client.Authenticate(_from, "password"); + client.Authenticate(email.FromEmail, email.Password); client.Send(message); client.Disconnect(true); } + err.lbl_title.Content = "Thank you!"; err.txtblk_error.Text = "Thank you for sending your email! We have it and will reply shortly."; err.ShowDialog(); diff --git a/DeskHubSharp/BusinessLayer/Request.cs b/DeskHubSharp/BusinessLayer/Request.cs index 4cd9905..74eebe8 100644 --- a/DeskHubSharp/BusinessLayer/Request.cs +++ b/DeskHubSharp/BusinessLayer/Request.cs @@ -10,7 +10,7 @@ namespace DeskHubSharp { class Request { - private string _apiEndpoint = "https://api.github.com/v3/"; + private string _apiEndpoint = "https://api.github.com/"; public Request() { diff --git a/DeskHubSharp/ErrorWindow.xaml b/DeskHubSharp/ErrorWindow.xaml index ff49bbb..881d56b 100644 --- a/DeskHubSharp/ErrorWindow.xaml +++ b/DeskHubSharp/ErrorWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:DeskHubSharp" mc:Ignorable="d" - Title="ErrorWindow" Height="200" Width="300 + Title="Response - DeskHubSharp" Height="200" Width="300 "> diff --git a/DeskHubSharp/FeedbackWindow.xaml b/DeskHubSharp/FeedbackWindow.xaml index 590b061..47499a6 100644 --- a/DeskHubSharp/FeedbackWindow.xaml +++ b/DeskHubSharp/FeedbackWindow.xaml @@ -8,7 +8,7 @@ Title="Feedback - DeskHubSharp" Height="450" Width="500"> diff --git a/DeskHubSharp/FeedbackWindow.xaml.cs b/DeskHubSharp/FeedbackWindow.xaml.cs index 7f61d3b..667e1f2 100644 --- a/DeskHubSharp/FeedbackWindow.xaml.cs +++ b/DeskHubSharp/FeedbackWindow.xaml.cs @@ -31,7 +31,7 @@ namespace DeskHubSharp private void btn_send_Click(object sender, RoutedEventArgs e) { - EmailBLL email = new EmailBLL(txtbox_name, txtbox_feedbackmessage); + EmailBLL email = new EmailBLL(txtbox_name.Text, txtbox_feedbackmessage.Text, txtbox_email.Text); email.CreateMessage(); } } diff --git a/DeskHubSharp/Models/Email.cs b/DeskHubSharp/Models/Email.cs index 8c9d98a..48caa9a 100644 --- a/DeskHubSharp/Models/Email.cs +++ b/DeskHubSharp/Models/Email.cs @@ -2,6 +2,32 @@ namespace DeskHubSharp { public class Email { + private string _toEmail = "wjmiller2016@gmail.com"; + private string _fromEmail = "wjmiller2016@gmail.com"; + private string _passwordEmail = "IhaveanAMDRX580"; + + public string Password + { + get { return _passwordEmail; } + set { _passwordEmail = value; } + } + + public string FromEmail + { + get { return _fromEmail; } + set { _fromEmail = value; } + } + + public string ToEmail + { + get { return _toEmail; } + set { _toEmail = value; } + } + + public Email() + { + + } } } \ No newline at end of file diff --git a/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache b/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache index 6cccf02..3e0c7da 100644 --- a/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache +++ b/DeskHubSharp/obj/Debug/DeskHubSharp.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -5fc4a31b9da29844dd7ba799c86639ce1bf7d4b0 +ac6d87119126ef96a9551362a1832c83be77d6c5 diff --git a/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache b/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache index bdc68df..fa17174 100644 --- a/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache +++ b/DeskHubSharp/obj/Debug/DeskHubSharp_MarkupCompile.cache @@ -12,7 +12,7 @@ DEBUG;TRACE C:\Users\Wyatt\Desktop\Source\DeskHubSharp\DeskHubSharp\App.xaml 7-86569338 -21133474928 +22-1533856682 20415715258 AboutWindow.xaml;DetailWindow.xaml;ErrorWindow.xaml;FeedbackWindow.xaml;HelpWindow.xaml;MainWindow.xaml;SearchWindow.xaml;