you will have to download the Java Mail API where in mail.jar contains these classes.. also u will need some more jar files for mailing
-----Original Message----- From: Vijaya bhaskar K R [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 9:53 AM To: [EMAIL PROTECTED] Subject: Re: Mailing using Servlets Hi Yuriy, Plz tell me from which jdk javax.mail.*; package will be available. Thanks viju > ---------- > From: Юрий Степовой[SMTP:[EMAIL PROTECTED]] > Reply To: Юрий Степовой > Sent: Friday, March 15, 2002 9:13 PM > To: [EMAIL PROTECTED] > Subject: Re: Mailing using Servlets > > v> Hi, > v> i am developing a system that will run on the company intranet. as a > feature > v> of my software i want ppl to be able to send a mail. the company has a > mail > v> server. > v> mailto is not a good option because it opens up a new message window. i > v> tried using the java mail class and included the mail.jar in > jdk1.3.1/lib > v> and also included it in the class path. the servlet i wrote compiled > but did > v> not run (as in it showed the page not found error). > v> please guide me asto how to go about implementing it. > v> please send me some code if somebody has worked on it. > v> i am a litle new to this servlet bussiness so kindly explain in simple > v> terms. > > v> expecting good n swift help. > v> Vikas > > try > this example: > > MailSend.java > > import java.util.Properties; > import javax.mail.*; > import javax.mail.internet.*; > > public class MailSend { > public static void main (String args[]) > throws Exception { > String smtpHost = "your smtp server ip"; > String from = "[EMAIL PROTECTED]"; > String to = "[EMAIL PROTECTED]"; > > // Get system properties > Properties props = System.getProperties(); > > // Setup mail server > props.put("mail.smtp.host", smtpHost); > > // Get session > Session session = Session.getDefaultInstance(props, null); > > // Define message > MimeMessage message = new MimeMessage(session); > message.setFrom(new InternetAddress(from)); > message.addRecipient(Message.RecipientType.TO, new > InternetAddress(to)); > message.setSubject("Hello, Friend"); > message.setText("Test mail"); > > // Send message > Transport.send(message); > } > } > > > Best regards, > Yuriy > > __________________________________________________________________________ > _ > 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 DISCLAIMER: Information contained and transmitted by this E-MAIL is proprietary to MASCOT SYSTEMS LTD and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail & notify us immediately at [EMAIL PROTECTED] Before opening attachments, "Please scan for Viruses" ___________________________________________________________________________ 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