Please Help w/ converting this PHP to JSP

my knowledge of php is basic but my knowledge of jsp is 0.
below is a php email script i’ve been attempting to convert to jsp but have failed miserably.

<?
if(!empty($HTTP_POST_VARS['sms_smsTo']) && !empty($HTTP_POST_VARS['sms_taMessage']))
{
    $to = stripslashes($HTTP_POST_VARS['sms_smsTo']);
    $subject = stripslashes($HTTP_POST_VARS['sms_Subject']);
    $body = stripslashes($HTTP_POST_VARS['sms_taMessage']);
    //$body .= "

---------------------------
";
    //$body .= "Mail sent by: " . $HTTP_POST_VARS['sms_From'] . " <" . $HTTP_POST_VARS['sms_From']  . ">
";
    $header = "From: " . $HTTP_POST_VARS['sms_From'] . " <" . $HTTP_POST_VARS['sms_From'] . ">
";
    //$header .= "Reply-To: " . $HTTP_POST_VARS['sms_From'] . " <" . $HTTP_POST_VARS['sms_From'] . ">
";
    $header .= "X-Mailer: PHP/" . phpversion() . "
";
    $header .= "X-Priority: 3";
    if(@mail($to, $subject, $body, $header))
    {
        echo "output=success";
    } else {
        echo "output=error";
    }
} else {
    echo "output=error";
}
?>

i’ve done searches through these forums and google searches for for flash jsp email forms but have came up with nothing solid.
any help on how to achieve results will greatly be appreciated.

thank you