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;
// ÓʼþÖ÷Ìâ
Ïà¹ØÎĵµ£º
XMLÏÖÔÚÒѾ³ÉΪһÖÖͨÓõÄÊý¾Ý½»»»¸ñʽ,ƽ̨µÄÎÞ¹ØÐÔʹµÃºÜ¶à³¡ºÏ¶¼ÐèÒªÓõ½XML¡£±¾ÎĽ«Ïêϸ½éÉÜÓÃJava½âÎöXMLµÄËÄÖÖ·½·¨¡£
XMLÏÖÔÚÒѾ³ÉΪһÖÖͨÓõÄÊý¾Ý½»»»¸ñʽ,ËüµÄƽ̨ÎÞ¹ØÐÔ,ÓïÑÔÎÞ¹ØÐÔ,ϵͳÎÞ¹ØÐÔ,¸øÊý¾Ý¼¯³ÉÓë½»»¥´øÀ´Á˼«´óµÄ·½±ã¡£¶ÔÓÚXML±¾ÉíµÄÓ﷨֪ʶÓë¼¼Êõϸ½Ú,ÐèÒªÔĶÁÏà¹ØµÄ¼¼ÊõÎÄÏ×,ÕâÀïÃæ°üÀ¨µÄÄÚÈÝ ......
RuntimeExceptionlÀàÐ͵ÄÒì³£Ó¦Óñê×¼µÄ³ÌÐòÉè¼Æ¼¼ÇÉÀ´Ô¤·À£¬¶ø²»ÊÇʹÓÃtry-catch»úÖÆ²¶»ñ¡£Òþº¬Òì³£°üº¬ErrorsºÍRuntimeException£¬¶ÔÓÚºóÕßÓÃifÓï¾ä·ÀÖ¹²úÉú¡£Èç·ÃÎÊ¿ÉÄÜδÕýÈ·³õʼ»¯ÒýÓñäÁ¿Ç°£¬Ïȼì²éÊÇ·ñÖ¸Ïò¿ÕÖµ£»·ÃÎÊÊý×éʱ£¬Ïȼì²éϱêÊÇ·ñÔ½½ç¡£
×Ô¶¨ÒåÒì³££º´´½¨Ò»¸ö¼Ì³ÐExceptionµÄÀà»òÆäËûÒÑ´æÔÚµÄ×ÓÀ࣬´´½¨Ò ......
а²×°ÁË JDK 6 µÄ³ÌÐòÔ±ÃÇÒ²Ðí»á·¢ÏÖ£¬³ýÁË´«Í³µÄ bin¡¢jre µÈĿ¼£¬JDK 6 ÐÂÔöÁËÒ»¸öÃûΪ db µÄĿ¼¡£Õâ±ãÊÇ Java 6 µÄгÉÔ±£ºJava DB¡£ÕâÊÇÒ»¸ö´¿ Java ʵÏÖ¡¢¿ªÔ´µÄÊý¾Ý¿â¹ÜÀíϵͳ£¨DBMS£©£¬Ô´ÓÚ Apache Èí¼þ»ù½ð»á£¨ASF£©ÃûϵÄÏîÄ¿ Derby¡£ËüÖ»ÓÐ 2MB ´óС£¬¶Ô±È¶¯éüÉÏ G µÄÊý¾Ý¿âÀ´Ëµ¿ÉνÐäÕä¡£µ«Õâ²¢²»·Á° Derby ......
Abstract
ÔÚ¿ª·¢ÖУ¬Èç¹ûij¸öʵÀýµÄ´´½¨ÐèÒªÏûºÄºÜ¶àϵͳ×ÊÔ´£¬ÄÇôÎÒÃÇͨ³£»áʹÓöèÐÔ¼ÓÔØ»úÖÆ£¬Ò²¾ÍÊÇ˵ֻÓе±Ê¹Óõ½Õâ¸öʵÀýµÄʱºò²Å»á´´½¨Õâ¸öʵÀý£¬Õâ¸öºÃ´¦ÔÚ
µ¥ÀýģʽÖеõ½Á˹㷺ӦÓá£Õâ¸ö»úÖÆÔÚsingle-threaded»·¾³ÏµÄʵÏַdz£¼òµ¥£¬È»¶øÔÚmulti-threaded» ......
·Ç³£¼òµ¥,ÔÚC#ÖÐÖ»ÐèÒªÔÚÀàµÄ·½·¨µÄÉÏ·½ÇÃÈýÏÂ"/"¾Í×Ô¶¯°ïÄãÌí¼ÓÏà¹ØµÄ´úÂë,ÄãÖ»Òª°´×ÅÌîд¾Í¿ÉÒÔÁË,¶øJavaÔòÊÇÊäÈë"/**",ËüÒ²»á×Ô¶¯ÐγÉÏà¹Ø´úÂë,¾ßÌå´úÂëÈçÏÂ:
C#
/// <summary>
/// ÔÚ´ËÌîд×ÜÌåÃèÊö
///</summary>
/// <param name="name">ÕâÀïÌîд²ÎÊýnameµÄÃèÊö</param>
public string ......