java ·¢ËÍÓʼþʵÀý
package com.sj.main;
public class Snippet {
public static void main(String[] args){
//Õâ¸öÀàÖ÷ÒªÊÇÉèÖÃÓʼþ
MailSenderInfo mailInfo = new MailSenderInfo();
String biaoti ="ÎÒÊÇËÕ½¨£¬ÕâÊÇÎҵIJâÊÔÓʼþ";
String neirong = "ÎÒÊÇËÕ½¨ÒÔÏÂÊÇÎҵIJâÊÔÓʼþ£¬»¶Ó´ó¼Ò½øÐвâÊÔ¡£±¾³ÌÐòʹÓõÄÊÇJavaÓ¦ÓóÌÐò¿ª·¢µÄ" +
"ÎÒÃÇÒÔϵijÌÐò´úÂë½øÐÐ×¢²áÁ¬½Óhttp://blog.csdn.net/sujianchinaouya";
String towho="112606652@qq.com";
mailInfo.setMailServerHost("smtp.163.com");
mailInfo.setMailServerPort("25");
mailInfo.setValidate(true);
mailInfo.setUserName("sujiansoft@163.com");
mailInfo.setPassword("03585726709");//ÄúµÄÓÊÏäÃÜÂë
mailInfo.setfromAddress("sujiansoft@163.com");
mailInfo.setToAddress(towho);
mailInfo.setSubject(biaoti);
mailInfo.setContent(neirong);
//Õâ¸öÀàÖ÷ÒªÀ´·¢ËÍÓʼþ
SimpleMailSender sms = new SimpleMailSender();
sms.sendTextMail(mailInfo);//·¢ËÍÎÄÌå¸ñʽ
System.out.println(mailInfo);
// sms.sendHtmlMail(mailInfo);//·¢ËÍhtml¸ñʽ
}
}
Java·¢ËÍÓʼþ
MailSenderInfo.java
package com.sj.main;
/** *//**
* ·¢ËÍÓʼþÐèҪʹÓõĻù±¾ÐÅÏ¢
*author by wangfun
http://www.5a520.cn С˵520
*/
import java.util.Properties;
public class MailSenderInfo {
// ·¢ËÍÓʼþµÄ·þÎñÆ÷µÄIPºÍ¶Ë¿Ú
private String mailServerHost;
private String mailServerPort = "25";
// Óʼþ·¢ËÍÕߵĵØÖ·
private String fromAddress;
// Óʼþ½ÓÊÕÕߵĵØÖ·
private String toAddress;
// µÇ½Óʼþ·¢ËÍ·þÎñÆ÷µÄÓû§ÃûºÍÃÜÂë
private String userName;
private String password;
// ÊÇ·ñÐèÒªÉí·ÝÑéÖ¤
private boolean validate = false;
// ÓʼþÖ÷Ìâ
Ïà¹ØÎĵµ£º
ΪÁ˱£Ö¤Ê¾Àý³ÌÐòµÄÔËÐУ¬±ØÐë°²×°Java 2 sdk1.4.0 ºÍJakarta POI£¬Jakarta POIµÄWebÕ¾µãÊÇ: http://jakarta.apache.org/poi/
ʾÀý1½«ÑÝʾÈçºÎÀûÓÃJakarta POI API ´´½¨Excel Îĵµ¡£
ʾÀý1³ÌÐòÈçÏ£º
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import
org.apache.poi.hssf.usermodel.HSSFSheet;
impo ......
ʲô½Ð¶àỊ̈߳¿
Java³ÌÐòͨ¹ýÁ÷¿ØÖÆÀ´Ö´ÐгÌÐòÁ÷£¬³ÌÐòÖе¥¸ö˳ÐòµÄÁ÷¿ØÖƳÆÎªÏ̡߳£
Ï̺߳ͽø³ÌµÄÒìͬµãÔÚÄÄÀ
Ïàͬµã£ºËûÃÇÒ»ÑùÓµÓжÀÁ¢µÄÖ´ÐпØÖÆ£¬ÓɲÙ×÷ϵͳ¸ºÔðµ÷¶È¡£
²»Í¬µã£ºÏß³ÌûÓжÀÁ¢µÄϵͳ×ÊÔ´£¬Í¬Ò»½ø³ÌÖеÄËùÓÐÏ̹߳²Ïí½ø³ÌµÄϵͳ×ÊÔ´£¬Èç´æ´¢¿Õ¼ä¡¢´ÅÅÌÎļþ¡¢´òÓ¡»úµÈ¡£
ÓÉÓÚ¸÷¸öÏ̵߳ĿØÖÆÁ÷±Ë´Ë¶À ......
Abstract
ÔÚ¿ª·¢ÖУ¬Èç¹ûij¸öʵÀýµÄ´´½¨ÐèÒªÏûºÄºÜ¶àϵͳ×ÊÔ´£¬ÄÇôÎÒÃÇͨ³£»áʹÓöèÐÔ¼ÓÔØ»úÖÆ£¬Ò²¾ÍÊÇ˵ֻÓе±Ê¹Óõ½Õâ¸öʵÀýµÄʱºò²Å»á´´½¨Õâ¸öʵÀý£¬Õâ¸öºÃ´¦ÔÚ
µ¥ÀýģʽÖеõ½Á˹㷺ӦÓá£Õâ¸ö»úÖÆÔÚsingle-threaded»·¾³ÏµÄʵÏַdz£¼òµ¥£¬È»¶øÔÚmulti-threaded» ......
Ê×ÏÈjava½Ó¿ÚºÍ³éÏóÀà´ú±íµÄ¾ÍÊdzéÏóÀàÐÍ£¬¾ÍÊÇÎÒÃÇÐèÒªÌá³ö³éÏó²ãµÄ¾ßÌåʵÏÖ£¬Èç¹ûÒªÌá¸ß³ÌÐòµÄ¸´ÓÃÂÊ£¬¿Éά»¤ÐÔ£¬¿ÉÀ©Õ¹ÐÔ£¬¾Í±ØÐëÃæÏò½Ó¿ÚºÍ³éÏó±à³Ì£¬ÕýȷʹÓÃËûÃÇ¡£ £¨1£©³éÏóÀà¿ÉÒÔÌṩʵÏÖ·½·¨£¬½Ó¿Ú²»ÄÜ
ÕâÊdzéÏóÀàµÄΨһÓŵ㣬¶øÇҷdz£ÓÐÓã¬ÀýÈ磬Ä㶨ÒåÒ»¸ö½Ó¿Ú£¬×ÓÀ಻ÐèÒªËûµÄËùÓз½·¨£¬¿ÉÊÇÄãû°ì·¨²»È¥ ......