thank you for your help, greatly appreciate it but every time I try to run this program i get this error:

Exception in thread "main" mails.txt (The system
cannot find the file specified)
at Method)
at java.util.Scanner.<init>(
at CheckMail.main(
Press any key to continue . . .

sure you will get this message;
CHange the name "mails.txt" to the name of your file where you put the data.

the file where each record contains a student's last name (one word only) and email address.

As far as you are concerned with String validation of email addres,
you may use Regular Expression in Java...

String email = "";
boolean isValidEmail = email.matches("[\\w.]+@[\\w]+\\.[\\w]+");