Recently, I've just completed writing a sample program to send and receive emails. To simplify my testing procedure, I used JUnit4 and GreenMail to help me. However, every endeavor to send an email from localhost ended up with failure during my testing process. The error message is just like below:
"java mail address is invalid on local machine ..."
I've searched for solutions on the web but cannot solve my problem since all of my configuration is correct. Fortunately, I finally find a way to get over it. That is, just simply turn down your anti-virus programs and your firewalls, or, in another way, add exception for your mail program in firewall policy. That's it!