From beaa47492b8e3db16649a96ba8ce643d501a689e Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Tue, 18 Dec 2018 10:57:03 -0800 Subject: [PATCH] Fix for writing SMTP credentials to config file --- vmPing/Classes/Configuration.cs | 8 +++++--- vmPing/Properties/AssemblyInfo.cs | 4 ++-- vmPing/Views/OptionsWindow.xaml.cs | 6 ++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/vmPing/Classes/Configuration.cs b/vmPing/Classes/Configuration.cs index 54e04b3..73167af 100644 --- a/vmPing/Classes/Configuration.cs +++ b/vmPing/Classes/Configuration.cs @@ -154,7 +154,7 @@ public static void WriteConfiguration() { configuration.AppendChild(GenerateOptionNode( xmlDocument: xd, - name: "EmailPassword", + name: "EmailUser", value: string.Empty)); } @@ -393,11 +393,13 @@ public static void LoadConfiguration() if (configuration.TryGetValue("EmailUser", out optionValue)) { - ApplicationOptions.EmailUser = DecryptStringAES(optionValue); + if (optionValue.Length > 0) + ApplicationOptions.EmailUser = DecryptStringAES(optionValue); } if (configuration.TryGetValue("EmailPassword", out optionValue)) { - ApplicationOptions.EmailPassword = DecryptStringAES(optionValue); + if (optionValue.Length > 0) + ApplicationOptions.EmailPassword = DecryptStringAES(optionValue); } } diff --git a/vmPing/Properties/AssemblyInfo.cs b/vmPing/Properties/AssemblyInfo.cs index 5693b0c..a0e4890 100644 --- a/vmPing/Properties/AssemblyInfo.cs +++ b/vmPing/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.10.0")] -[assembly: AssemblyFileVersion("1.2.10.0")] +[assembly: AssemblyVersion("1.2.11.0")] +[assembly: AssemblyFileVersion("1.2.11.0")] diff --git a/vmPing/Views/OptionsWindow.xaml.cs b/vmPing/Views/OptionsWindow.xaml.cs index c435f17..861e0a5 100644 --- a/vmPing/Views/OptionsWindow.xaml.cs +++ b/vmPing/Views/OptionsWindow.xaml.cs @@ -242,6 +242,12 @@ private bool SaveEmailAlertOptions() return false; } } + else + { + ApplicationOptions.IsEmailAuthenticationRequired = false; + SmtpUsername.Text = string.Empty; + SmtpPassword.Password = string.Empty; + } ApplicationOptions.IsEmailAlertEnabled = true; ApplicationOptions.EmailServer = SmtpServer.Text;