What is the best way to check the cc field in an email for correct addresses?
For example if I have cc: [email protected];[email protected];asdfj
How can I detect the asdfj as an invalid address?
I'm using java. The best way I can think of is using a stringtokenizer but I'm not sure how to implement this.
The code I had earlier checks the cc field but only for one email address using this:
if( (!Cc.equals("")) && ccat != Cc.lastIndexOf('@')) {
System.out.println("CC: address is invalid 2");
return false;
}
Thanks.