First off, this forum is about web services, not JavaMail, so this topic may get moved to a more appropriate forum.
I have all codes needed,but it does not work.
That's not a very useful problem description. What is the code supposed to do, and what happens when you run it? Any exceptions, error messages, ...?
I know it needs a mail server,but I have not any information about it. How I can download it?
Are you saying that you do not have a mail server, but want to install one in order to use it with JavaMail? If so, have a look at
James, an open source
Java SMTP and POP3 server.
If you have more fundamental questions about JavaMail, check out the
J2EE FAQ, which links to a number of helpful JavaMail resources.