Java ·¢ËÍ Email
·¢ËÍ email ÐèÒª email.jar activation.jar
-----------------------------------------------
package tao.email;
import java.util.Date;
import java.util.Properties;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class MailSender {
private String smtp = "smtp.qq.com"; // Óʼþ·þÎñÆ÷
private String username = "786792111";
private String password = "xxxxx";
private String from = username+"@qq.com";
EmailAuthenticator auth = new EmailAuthenticator(this.username,this.password);
Properties props = System.getProperties();
{
props.put("mail.smtp.host",smtp);
props.put("mail.smtp.auth", "true");
}
Session session = Session.getDefaultInstance(props,(Authenticator)auth);
Message msg = new MimeMessage(session);
public void sendTo(String to){
try{
msg.setfrom(new InternetAddress(from));
msg.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
msg.setSubject("Óû§×¢²áÑéÖ¤");
msg.setSentDate(new Date());
 
Ïà¹ØÎĵµ£º
±¾ÎĽéÉܵÄJAVA¹æÔòµÄ˵Ã÷·ÖΪ3¸öÖ÷Òª¼¶±ð£¬Öм¶ÊÇƽʱ¿ª·¢ÓõıȽ϶àµÄ¼¶±ð£¬ÔÚ½ñºó½«Â½Ðøд³öÆäËûµÄ¹æÔò¡£×ñÊØÁËÕâЩ¹æÔò¿ÉÒÔÌá¸ß³ÌÐòµÄЧÂÊ¡¢Ê¹´úÂëÓÖ¸üºÃµÄ¿É¶ÁÐԵȡ£
£¨1£© ÔÚfinally·½·¨Àï¹Øµôinput»òÕßoutput ×ÊÔ´
ÔÙ·½·¨ÌåÀïÃ涨ÒåÁËinput»òÕßoutputÁ÷µÄ»°£¬ÐèÒªÔÚfinallyÀïÃæ°ÑËü¹Øµô¡£
ÒÔÏÂ ......
ÅжÏÌ⣺ÉùÃ÷int a = 10; ÅжÏÒÔÏÂ3¸öÔËËãÊÇ·ñÄܹ»·Ö±ðͨ¹ýJava±àÒëÆ÷£º
a = a/2; a = a/3; a = a*2.89;
½â£ºa = a*2.89;²»ÐУ¬a*2.89ÔËËã»áÌáÉý³ÉdoubleÀàÐÍ
Êý×éÓÐûÓÐlength()Õâ¸ö·½·¨? StringÓÐûÓÐlength()Õâ¸ö·½·¨£¿
½â£ºÊý×éûÓÐlength()Õâ¸ö·½·¨£¬ÓÐlengthµÄÊôÐÔ¡£
¡¡¡¡ StringÓÐÓÐlength()Õ ......
ÀûÓÃoracle×Ô´øµÄutl_file°ü¿ÉÒÔ·ÃÎÊ´ÅÅÌÎļþ£¬µ«ÓиöÏÞÖÆ--ÎÞ·¨·ÃÎÊÎļþ¼Ð£¿Ê²Ã´Òâ˼ÄØ£¿¾ÍÊÇ˵oracleÖ»ÄÜ·ÃÎÊÖ¸¶¨µÄÎļþ£¬¶ø²»ÄÜ·ÃÎÊÎļþ¼ÐϵÄδ֪Îļþ¡£ËùÒÔ£¬Èç¹ûҪͨ¹ýoracleÈ¥±éÀúijָ¶¨Â·¾¶ÏµÄËùÓÐÎļþ£¬sorry, impossible! µ«ÊÇ£¬ÓÐÒ»ÖÖÌæ´ú·½°¸¿ÉÒÔÖúÄãÒ»±ÛÖ®Á¦£¡
ÖÚËùÖÜÖªjavaÖ®FileÀàÖ¸ÏòµÄ¿ÉÒÔÊÇĿ¼Ҳ¿ÉÒÔÊ ......
javaÀàµÄ³ÉÔ±±äÁ¿ÓÐÁ©ÖÖ£º
Ò»ÖÖÊDZ»static¹Ø¼ü×ÖÐÞÊεıäÁ¿£¬½ÐÀà±äÁ¿»òÕß¾²Ì¬±äÁ¿
ÁíÒ»ÖÖûÓÐstaticÐÞÊΣ¬ÎªÊµÀý±äÁ¿ ÀàµÄ¾²Ì¬±äÁ¿ÔÚÄÚ´æÖÐÖ»ÓÐÒ»¸ö£¬javaÐéÄâ»úÔÚ¼ÓÔØÀàµÄ¹ý³ÌÖÐΪ¾²Ì¬±äÁ¿·ÖÅäÄڴ棬¾²Ì¬±äÁ¿Î»ÓÚ·½·¨Çø£¬±»ÀàµÄËùÓÐʵÀý¹²Ïí¡£ ¾²Ì¬±äÁ¿¿ÉÒÔÖ±½Óͨ¹ýÀàÃû½øÐзÃÎÊ£¬ÆäÉúÃüÖÜÆÚÈ¡¾öÓÚÀàµÄÉú ......