You must download Sun's JavaMail API package, address is: http://java.sun.com/products/javamail/ and add the associated package (JAR file) to ClassPath. Or if you install J2EE, add J2EE.jar to ClassPath. The source program is as follows, replacing the red portion. For you or if you have any questions, please let me discuss: petehero@126.com Import java.util. *; Import javax.mail. *; Import javax.mail.internet. *; / ** *
Title: Java Mail p> *
Description: p> *
Copyright: Copyright (c) 2004 p> *
company: p> * @Version 1.0 * / public class SendMail {public SendMail () {} public void send () {try {Properties props = new Properties (); Session sendMailSession; Store store; Transport transport; props.put ( "mail.smtp.auth", "true") "PrOPS.PUT (" mail.smtp.host "," smtp.yourmail.com "); // SMTP host name. Props.Put ("mail.smtp.user", "username@yourmail.com"); // senders email address. Props.Put ("mail.smtp.password", "888888"); // mail password. Popupauthenticator popa = new popupauthenticator (); // message security authentication.