Issue #2331097: Add tests for email sending