Refactored mail content generation.