Import java.util. *; import java.io. *; import javax.mail. *; import javax.mail.internet. *; import javax.activation. *;
/ ** *
Title: p> *
Description: p> *
Copyright: Copyright (c) 2004 p> *
Company: Softek System P> * @Author Softek System Development Team * @version 1.0 * /
Public class sendmail {
Public static void main (string [] args) {boolean is = new sendmail (). Sendmail ("Sender Address", "Recipient Address", "Title", "Letter Content"); IF (IS) SYSTEM .out.print ("ok!"); else system.out.print ("Error!");
}
private String smtpHost = "smtp.163.com"; public boolean sendMail (String fromAddress, String toAddress, String subject, String msgText) {boolean isOk = false; smtpHost = "smtp.163.com"; Properties props = new Properties ( ); Props.put ("mail.smtp.host", smtphost); automin auth = new automin ();