-
Notifications
You must be signed in to change notification settings - Fork 328
/
RelayOptions.cs
41 lines (32 loc) · 1.07 KB
/
RelayOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Ardalis.GuardClauses;
using MailKit.Security;
using System.Text.Json.Serialization;
namespace Rnwood.Smtp4dev.Server
{
public class RelayOptions
{
private int smtpPort = 25;
public bool IsEnabled => SmtpServer != string.Empty;
public string SmtpServer { get; set; } = string.Empty;
public int SmtpPort
{
get => smtpPort;
set
{
Guard.Against.OutOfRange(value, nameof(SmtpPort), 1, 65535);
smtpPort = value;
}
}
public SecureSocketOptions TlsMode { get; set; } = SecureSocketOptions.Auto;
public string[] AutomaticEmails { get; set; } = System.Array.Empty<string>();
public string SenderAddress { get; set; } = "";
public string Login { get; set; } = "";
public string Password { get; set; } = "";
[JsonIgnore]
public string AutomaticEmailsString
{
get => string.Join(",", AutomaticEmails);
set => this.AutomaticEmails = value.Split(',');
}
}
}