2020-10-30 13:56:13 +01:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2020-09-18 12:53:10 +02:00
|
|
|
|
using System.Net.Mail;
|
|
|
|
|
|
using Umbraco.Core.Configuration.Models.Validation;
|
2020-08-20 08:24:23 +01:00
|
|
|
|
|
2020-08-20 22:18:50 +01:00
|
|
|
|
namespace Umbraco.Core.Configuration.Models
|
2020-08-20 08:24:23 +01:00
|
|
|
|
{
|
2020-10-30 13:56:13 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Matches MailKit.Security.SecureSocketOptions and defined locally to avoid having to take
|
|
|
|
|
|
/// thi
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public enum SecureSocketOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
None = 0,
|
|
|
|
|
|
Auto = 1,
|
|
|
|
|
|
SslOnConnect = 2,
|
|
|
|
|
|
StartTls = 3,
|
|
|
|
|
|
StartTlsWhenAvailable = 4
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-09-18 12:53:10 +02:00
|
|
|
|
public class SmtpSettings : ValidatableEntryBase
|
2020-08-20 08:24:23 +01:00
|
|
|
|
{
|
2020-09-18 12:53:10 +02:00
|
|
|
|
[Required]
|
|
|
|
|
|
[EmailAddress]
|
2020-08-20 08:24:23 +01:00
|
|
|
|
public string From { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Host { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int Port { get; set; }
|
|
|
|
|
|
|
2020-10-30 13:56:13 +01:00
|
|
|
|
public SecureSocketOptions SecureSocketOptions { get; set; } = SecureSocketOptions.Auto;
|
|
|
|
|
|
|
2020-08-20 08:24:23 +01:00
|
|
|
|
public string PickupDirectoryLocation { get; set; }
|
|
|
|
|
|
|
2020-09-21 21:20:46 +02:00
|
|
|
|
public SmtpDeliveryMethod DeliveryMethod { get; set; } = SmtpDeliveryMethod.Network;
|
2020-08-20 08:24:23 +01:00
|
|
|
|
|
|
|
|
|
|
public string Username { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public string Password { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|