hi fellow developers,

i'm sorry if this is 'slightly' off-topic.

i'm developing an "auto-email"  which would send an email to those users
who
registered with us.  I have a doubt...do I have to include any password
or
username in my coding?  coz it's like, when we are sending our mail
through
Netscape Messenger, we actually have to type in our password in order to
have
the mail sent through.  if so, how do i go about?

below is my coding.

thanks for any help.

cedric

------------------------------------------------------------------------------------------------

//email applicant after their registration
 try {
   //Create the Javamail session
   java.util.Properties properties = System.getProperties();
   properties.put ("mail.smtp.host", "imap1.sains.com.my");
   Session session = Session.getInstance(properties, null);

   //Constructs message
   MimeMessage message = new MimeMessage(session);
   message.setFrom(new InternetAddress (from));
   message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(to));
   message.setSubject(subject);
   message.setText(text);
   message.setHeader("X-Mailer", "Servlet Mailer");

   Transport.send(message);
   status = "Your message has been sent";
  }
  catch (AddressException e) {
   status = "There was an error parsing the addresses";
  }
  catch (SendFailedException e) {
   status = "There was an error sending the message";
  }
  catch (MessagingException e) {
   status = "There was an unexpected Error";
  }
  System.out.println(status);

___________________________________________________________________________
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

Reply via email to