sample  java code for testing emails.