The mail server needs SMTP authentication, use another mail server that enables SMTP without authentication. I think yahoo is not a good choice. you can test your mail server by using outlook before using JavaMail.