try this way:
SpedisciPosta(){
try{
Properties properties = new Properties();
properties.put("mail.smtp.host",ServerP);
properties.put("mail.from",IndPosta);
Session session = Session.getInstance(properties, null);
Message message = new MimeMessage(session);
InternetAddress[] address = {new InternetAddress("[EMAIL PROTECTED]")};
message.setRecipients(Message.RecipientType.TO, address);
message.setFrom(new InternetAddress(IndPosta));
message.setSubject("subject decription");// Insert subject
message.setContent("content,"text/html");// insert content here
I've insert html type but can also use "text/plain
Transport.send(message,address);
}catch(Exception e) {
System.out.println(e.toString());
}
}
Regards
Rinaldo Bonazzo
Resp.IT Sardinia Point
Tel. +39 070 673178
Cel. +39 0328 2898778
Email [EMAIL PROTECTED]
-----Messaggio originale-----
Da: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]Per conto di roy
woods
Inviato: giovedi 22 marzo 2001 13.48
A: [EMAIL PROTECTED]
Oggetto: sending email from html form? how
Hi all
How can I send an email from html form? I know I
should have the JavaMail package first and should know
the name of the SMTP. what else do I need to have?
Could someone be kind enough to post a simple code
that sends the an email to the email especified in the
form with the content in the form's textarea?
thanks in advance
Roy--
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html