Added Java version of mail.php