HI

// Code start here:
String FromEmailAddr="[EMAIL PROTECTED];
String ToEmailAddr="[EMAIL PROTECTED]";

String[] emailMessage = new String[3];
emailMessage[0] = "Subject:blabla ";
emailMessage[1] = "Bla bla";
emailMessage[2] = "Bla bla";

URL u = new URL("mailto:" + email);      // Create a mailto: URL
URLConnection c = u.openConnection(); // Create a URLConnection for it

c.setDoInput(false);                  // Specify no input from this URL
c.setDoOutput(true);                  // Specify we'll do output
c.connect();                          // Connect to mail host
PrintWriter outmail =                 // Get output stream to mail host
          new PrintWriter(new OutputStreamWriter(c.getOutputStream()));

// Write out mail headers.  Don't let users fake the From address
outmail.println("From: " + FromEmailAddr);   // from email
outmail.println("To: " + ToEmailAddr);
outmail.println(emailMessage[0]);             // Subject
outmail.println();  // blank line to end the list of headers

outmail.println(emailMessage[1]);         // 1 row
outmail.println(emailMessage[2]);         // 2 row

// Close the stream to terminate the message
outmail.close();

// Code end Here.

That's work.
Marin


----- Original Message -----
From: "Antonio W. Lagnada" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 13, 2000 6:17 PM
Subject: Send Mail Example


> Hello All,
>
> Does anyone have a simple example on how send an email for in JSP or
> Servlet?
>
> Any help would be appreciated.
> Thanks
>
> --
> Antonio W. Lagnada
> Ecommerce Consultant
> [EMAIL PROTECTED]
>
> This email address is specifically
> for JSP-Interest email list.
> Remove _NOSPAM for the actual email.
>
>
>
> ___________________________________________________________________
> To get your own FREE ZDNet Onebox - FREE voicemail, email, and fax,
> all in one place - sign up today at http://www.zdnetonebox.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to