Files
Umbraco-CMS/src/Umbraco.Core/Configuration/Models/SmtpSettings.cs
Andy Butland bdb8f34da3 Netcore: Health check notifier hosted service (#9295)
* Implemented health check notifier as a hosted service.
Added validation to health check settings.

* Registered health check notifier as a hosted service.
Modified health check nested settings to use concrete classes to align with other configuration models.

* Resolved issues with email sending using development server.

* PR review comments and fixed failing unit test.

* Changed period and delay millisecond and hourly values to TimeSpans.
Changed configuration of first run time for health check notifications to use H:mm format.

* Set up SecureSocketOptions as a locally defined enum.

* Tightened up time format validation to verify input is an actual time (with hours and minutes only) and not a timespan.

* Aligned naming and namespace of health check configuration related classes with other configuration classes.

* Created constants for hex colors used in formatting health check results as HTML.

* Revert "Tightened up time format validation to verify input is an actual time (with hours and minutes only) and not a timespan."

This reverts commit f9bb8a7a825bcb58146879f18b47922e09453e2d.

* Renamed method to be clear validation is of a TimeSpan and not a time.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-30 13:56:13 +01:00

41 lines
1.0 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.Net.Mail;
using Umbraco.Core.Configuration.Models.Validation;
namespace Umbraco.Core.Configuration.Models
{
/// <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
}
public class SmtpSettings : ValidatableEntryBase
{
[Required]
[EmailAddress]
public string From { get; set; }
public string Host { get; set; }
public int Port { get; set; }
public SecureSocketOptions SecureSocketOptions { get; set; } = SecureSocketOptions.Auto;
public string PickupDirectoryLocation { get; set; }
public SmtpDeliveryMethod DeliveryMethod { get; set; } = SmtpDeliveryMethod.Network;
public string Username { get; set; }
public string Password { get; set; }
}
}