Fixed #22734 -- Moved SMTP-related settings to a dictionary

Thanks Julian Wachholz for the report and the initial patch.
`keys()` needed?