I'm stumbling over the use of the word, `gateway` for this.  `gateway` is not the email transmitter; rather it's the email *generator*. An instance of `MailSender` is what sends it.  If you want an optionally difference mail generator, then rename `gateway` to `email_generator` or something like that.