The account-level SMTP config (configured via Settings > Email) was
ignored when Rails-level SMTP delivery was also configured. The env var
early-return path ran before the DB config lookup, so the "Send from
Email" field had no effect — emails were sent from the SMTP username
instead.
Move the account-level DB config check before the env var fallback so
the UI setting takes precedence. SMTP_FROM env var still works as a
fallback when no account-level config exists.
Also guard against missing SMTP_FROM with a default empty string to
avoid KeyError when the env var is unset and no DB config is present.
Fixes#598