--- RBonazzo <[EMAIL PROTECTED]> wrote:
> 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
Do I really need to create an object of Session type?
I mean can I skip this line:
Session session = Session.getInstance(properties,
null);
The mail is to be sent from a servlet.
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