This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Probably you aren't receiving any e-mails from that code because your e-mail server (the one you sent the e-mails to) doesn't trust your program's e-mail server (the one you're sending the e-mails from). Your server will be doing something like examining the from-address on the e-mail and seeing if it came from the actual server for the from-address's domain. If it didn't, then it considers the e-mail to be a forgery.
And since the from-address is "test1@localhost", it's pretty clearly a forgery. You need to do two things: use a from-address which belongs to a domain, and send the e-mail from that domain's e-mail server.