Added debug mode for email testing.