ActionMailer: don't send emails in the test environment and define ENV variables

This fixes some failing tests since these environment variables were not
defined