This was sent previously on the list. Haven't tried it but knowing the
experience level of the people here, looks like a viable solution. Regards
to the author: Rinaldo Bonazzo [EMAIL PROTECTED]
private void inviaMail(String IndMail, String Name)
{
try
{
Properties properties = new Properties();
properties.put("mail.smtp.host","smtp.galactica.it");
properties.put("mail.from","[EMAIL PROTECTED]");
Session session = Session.getInstance(properties, null);
Message message = new MimeMessage(session);
InternetAddress[] address = {new InternetAddress(IndMail)};
message.setRecipients(Message.RecipientType.TO, address);
message.setFrom(new InternetAddress(fromaddress);
message.setSubject(Subject);
message.setContent(Name+"\n"+text,"text/plain");
Transport.send(message,address);
}catch(Exception e) {
System.out.println(e);
}
}
Good luck...
Karl D. Parker
Core Technologies
RetailDNA, LLC
<<http://www.walkerdigital.com/Companies/companies.cfm?screen_id=4.3>> - A
Walker Digital Company
One Stamford Plaza
Stamford, CT 06902
203-564-1458 | 203-564-1772 (fax) | 330-8051272 (cell)
This message, together with any attachments, is intended only for the use of
the individual or entity to which it is addressed and may contain
information that is legally privileged, confidential, and exempt from
disclosure. If you are not the intended recipient, you are hereby notified
that you have received this message in error; any review, dissemination,
distribution, or copying of this message, or any attachment, is strictly
prohibited. If you have received this message in error, please delete this
message and any attachments from your computer and immediately notify the
original sender at (203) 564-1432 or by return e-mail. Thank you
-----Original Message-----
From: John Bell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 01, 2000 5:41 AM
To: [EMAIL PROTECTED]
Subject: Re: JavaMail
Hi,
I am trying to send e-mail from a servlet. I have code taken from the
Fields JSP Book.
I am running Windows 2000 which has a SMTP server running and have to send
the mail via a dial up link to my ISP.
I am not sure how the SMTP bit hangs together eg.
Properties mailProps = new Properties();
mailProps.put("mail.smtp.host", "what should go in here??");
and what do I set to get the computer to dial up and actually send the
message?
Can anyone help or point me in the right direction please.
John
> 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
___________________________________________________________________________
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