Added tests for email functions