Makes upgrade to Mailkit fully backward compatible

This commit is contained in:
Hermes Sbicego
2023-11-10 08:49:36 +01:00
committed by GitHub
parent 03884cbd64
commit 4e73190ae5

View File

@@ -37,7 +37,7 @@ namespace Orchard.Email.Models {
public SmtpEncryptionMethod EncryptionMethod {
#pragma warning disable CS0618 // Type or member is obsolete
// Reading EnableSsl is necessary to keep the correct settings during the upgrade to MailKit.
get { return this.Retrieve(x => x.EncryptionMethod, EnableSsl ? SmtpEncryptionMethod.SslTls : SmtpEncryptionMethod.None); }
get { return this.Retrieve(x => x.EncryptionMethod, EnableSsl ? (Port == 587 ? SmtpEncryptionMethod.StartTls : SmtpEncryptionMethod.SslTls) : SmtpEncryptionMethod.None); }
#pragma warning restore CS0618 // Type or member is obsolete
set { this.Store(x => x.EncryptionMethod, value); }
}
@@ -82,4 +82,4 @@ namespace Orchard.Email.Models {
return true;
}
}
}
}