Radarr/NzbDrone.Core/Notifications/Email/EmailSettings.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2013-05-19 23:17:32 +00:00
using System;
using NzbDrone.Core.Annotations;
2013-05-27 05:44:54 +00:00
namespace NzbDrone.Core.Notifications.Email
2013-05-19 23:17:32 +00:00
{
2013-05-27 05:44:54 +00:00
public class EmailSettings : INotifcationSettings
2013-05-19 23:17:32 +00:00
{
2013-05-27 05:44:54 +00:00
[FieldDefinition(0, Label = "Server", HelpText = "Hostname or IP of Email server")]
2013-05-19 23:17:32 +00:00
public String Server { get; set; }
2013-05-27 05:44:54 +00:00
[FieldDefinition(1, Label = "Port")]
2013-05-19 23:17:32 +00:00
public Int32 Port { get; set; }
2013-05-27 05:44:54 +00:00
[FieldDefinition(2, Label = "Use SSL", HelpText = "Does your Email server use SSL?")]
2013-05-19 23:17:32 +00:00
public Boolean UseSsl { get; set; }
2013-05-27 05:44:54 +00:00
[FieldDefinition(3, Label = "Username")]
2013-05-19 23:17:32 +00:00
public String Username { get; set; }
2013-05-27 05:44:54 +00:00
[FieldDefinition(4, Label = "Password")]
2013-05-19 23:17:32 +00:00
public String Password { get; set; }
2013-05-27 05:44:54 +00:00
[FieldDefinition(5, Label = "Sender Address")]
2013-05-19 23:17:32 +00:00
public String From { get; set; }
2013-05-27 05:44:54 +00:00
[FieldDefinition(6, Label = "Recipient Address")]
2013-05-19 23:17:32 +00:00
public String To { get; set; }
public bool IsValid
{
get
{
return !string.IsNullOrWhiteSpace(Server) && Port > 0 && !string.IsNullOrWhiteSpace(From) && !string.IsNullOrWhiteSpace(To);
}
}
}
}