I've been searching the web the while day and can't find any info that helps me on this so if anyone can give a hand I would REALLY appreciate it.

I am making an application where after a user signs up a jsp page saves his data to a DB, autogenerates a pwd and sends it by email to the user. I have everything working perfectly except for the last part.

How do I send an email on a jsp page? I seen everywhere that I need a smtp server to do this, which I don't currently have set up and am unsure if the server where this will jsp page is going to end up will have one or if I will be able to use it. I know that in PHP you can send an email my simply using

$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");

Is there a simple way to send an email on jsp? I'm new to this programming language and this is really frustrating me! So if anyone can please help me!