Stack Overflow answer to fix mailer