do not define mailer if ActionMailer is not defined

closes #2659
Merge pull request #2662 from plataformatec/issue-2659

do not define mailer if ActionMailer is not defined