You need to configure the Java mail to talk to a mail server. I doubt you have mail server on your local machine. Moreover, Mail servers usually accept SMTP connections through 25 port.