mirror of
https://bitbucket.org/anguist/ntpa
synced 2026-09-30 14:01:13 +00:00
SSL support for sending mail
This commit is contained in:
@@ -42,7 +42,10 @@ namespace Ntp.Analyzer.Config.Root
|
||||
string subject,
|
||||
string sender,
|
||||
string server,
|
||||
int port)
|
||||
int port,
|
||||
string user,
|
||||
string pass,
|
||||
bool ssl)
|
||||
: base(configName, indentLevel, frequency, initialRun, fixedRun)
|
||||
{
|
||||
this.mail = mail;
|
||||
@@ -50,6 +53,9 @@ namespace Ntp.Analyzer.Config.Root
|
||||
this.sender = sender;
|
||||
this.server = server;
|
||||
this.port = port;
|
||||
this.user = user;
|
||||
this.pass = pass;
|
||||
this.ssl = ssl;
|
||||
}
|
||||
|
||||
public const string Identifier = "Notify";
|
||||
@@ -61,14 +67,21 @@ namespace Ntp.Analyzer.Config.Root
|
||||
"Mail",
|
||||
"Subject",
|
||||
"Sender",
|
||||
"Smtp",
|
||||
"Port"
|
||||
"SmtpHost",
|
||||
"SmtpPort",
|
||||
"SmtpUser",
|
||||
"SmtpPass",
|
||||
"EnableSsl"
|
||||
};
|
||||
|
||||
private readonly string mail;
|
||||
private readonly int port;
|
||||
private readonly string sender;
|
||||
private readonly string server;
|
||||
private readonly string subject;
|
||||
private readonly string user;
|
||||
private readonly string pass;
|
||||
private readonly bool ssl;
|
||||
|
||||
public string Mail {
|
||||
get { return mail; }
|
||||
@@ -90,6 +103,18 @@ namespace Ntp.Analyzer.Config.Root
|
||||
get { return port; }
|
||||
}
|
||||
|
||||
public string SmptUser {
|
||||
get { return user; }
|
||||
}
|
||||
|
||||
public string SmptPass {
|
||||
get { return pass; }
|
||||
}
|
||||
|
||||
public bool EnableSsl {
|
||||
get { return ssl; }
|
||||
}
|
||||
|
||||
protected override IEnumerable<Object> Items {
|
||||
get {
|
||||
return new object[] {
|
||||
@@ -101,7 +126,10 @@ namespace Ntp.Analyzer.Config.Root
|
||||
subject,
|
||||
sender,
|
||||
server,
|
||||
port
|
||||
port,
|
||||
user,
|
||||
pass,
|
||||
ssl ? 1 : 0
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -127,8 +155,11 @@ namespace Ntp.Analyzer.Config.Root
|
||||
GetOptionString (options, "Mail", Params [0], true),
|
||||
GetOptionString (options, "Subject", Params [0], true),
|
||||
GetOptionString (options, "Sender", Params [0], true),
|
||||
GetOptionString (options, "Smtp", Params [0], true),
|
||||
GetOptionInteger (options, "Port", Params [0], false, 25)
|
||||
GetOptionString (options, "SmtpHost", Params [0], true),
|
||||
GetOptionInteger (options, "SmtpPort", Params [0], false, 25),
|
||||
GetOptionString (options, "SmtpUser", Params [0], false),
|
||||
GetOptionString (options, "SmtpPass", Params [0], false),
|
||||
GetOptionBoolean (options, "EnableSsl", Params [0], false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user