do not define mailer if ActionMailer is not defined

closes #2659