SSL support for sending mail

This commit is contained in:
2016-03-26 20:12:00 +01:00
parent d3079cce59
commit c25c8365ae
6 changed files with 118 additions and 19 deletions
@@ -25,12 +25,13 @@
// THE SOFTWARE.
using System.Collections.Generic;
using System.Globalization;
using System.Net;
using System.Net.Mail;
using System.Text;
using Ntp.Analyzer.Config;
using Ntp.Analyzer.Config.Root;
using Ntp.Analyzer.Log;
using Ntp.Process;
using Ntp.Analyzer.Config.Root;
namespace Ntp.Analyzer.Process.Description
{
@@ -56,6 +57,13 @@ namespace Ntp.Analyzer.Process.Description
jobs = new List<Ntp.Process.Job> ();
client = new SmtpClient (config.SmptServer, config.SmtpPort);
if (config.SmptUser != null) {
client.Credentials = new NetworkCredential(
config.SmptUser, config.SmptPass ?? string.Empty);
}
client.EnableSsl = config.EnableSsl;
}
public override bool SingleThread {