fix mail function to work with both mailtrap and mandrill