tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kurt Kurniawan" <>
Subject Re: Java servlet and mailing
Date Fri, 22 Feb 2002 04:08:52 GMT
one simple way to do this is using this package:  You just have to import, and it comes with the J2SE, so don't have
to do anythin'
But you need to have an SMTP server running.


and do : sm = new;

mserver is your SMTP server name. Can be the ip address if you like.

rfrom and rto can be any String type, rto have to be email address of course. then do: PrintStream
msg = sm.startMessage();

	msg.println("To: ");
    		msg.print("Subject: ");
    		msg.println("your message");

That's it ! Don't forget to try and catch to see if this throws exceptions!



The information transmitted is intended only for the person or entity 
to which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, 
or taking of any action in reliance upon, this information by persons
or entities other than the intended recipient is prohibited.  If you 
have received this email in error, please notify the sender and delete
the material from your computer.

Internet communications are not secure.  You should scan this message 
and any attachments for viruses.  Under no circumstances do we accept 
liability for any loss or damage which may result from your receipt of 
this message or any attachments.

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message