Hi,
Java Mail API is just a mail client. You need to have a mail server installed/setup first. There are free ones available on the net. You can download and set up accounts in the server.
Mail server generally will have a pop3 server(for retrieving mails) and smpt server.(for sending mails)
Use your java client(which uses java mail api) to connect to mail server(POP3 server) for retrieving mails and (SMPT server) sending mails.