Fix SMTPRelay condition for sender email validation

Prior change was leaving sender null and not properly setting "From" address when used in a relay configuration. This caused emails to go to the deleted state and not be delivered.
This commit is contained in:
Jon Welfringer
2025-12-01 16:36:19 -08:00
committed by GitHub
parent a6069e572d
commit 171f9c84a0

View File

@ -186,7 +186,7 @@ namespace Oqtane.Infrastructure
var mailboxAddressValidationError = "";
// sender
if (settingRepository.GetSettingValue(settings, "SMTPRelay", "False") != "True")
if ((settingRepository.GetSettingValue(settings, "SMTPRelay", "False") == "True") && string.IsNullOrEmpty(fromEmail))
{
fromEmail = settingRepository.GetSettingValue(settings, "SMTPSender", "");
fromName = string.IsNullOrEmpty(fromName) ? site.Name : fromName;