you can use the smtp client.

here is  a code sample that I founf in servlet programming by hunter.

  try{
      SmtpClient smtp = new SmtpClient("give the name of your server") ;
      smtp.from("MailServlet") ;
      smtp.to("[EMAIL PROTECTED]") ;
      PrintStream msg=smtp.startMessage() ;
      msg.println("\r\n") ;
      msg.println("From:myForm");
      msg.println("To: [EMAIL PROTECTED]");
      msg.println("Subject: PC Orders") ;
      msg.println("Body: PC Orders") ;

      msg.println("The following order request was submitted");

      msg.flush() ;
      msg.close() ;
      smtp.closeServer() ;

      out.println("thanks for the submission...") ;
     }
     catch (IOException e)
     {
        out.println("there was a problem sending mail") ;
     }

-----Original Message-----
From: Gonzalo Josi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 07, 1999 9:50 AM
To: [EMAIL PROTECTED]
Subject: How to send an e-mail from JSP


Hi all.
I want to send data from a form included in a JSP file to an e-mail address
formatted in a certain way.
How can I do it?
Thanks in advance.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to