Java MailÎÞ·¨½âÎö´ø·ÖºÅµÄÊÕ¼þÈËÁбíµÄÎÊÌâ
Java MailÎÞ·¨½âÎö´ø·ÖºÅµÄÊÕ¼þÈËÁбíµÄÎÊÌâ
½ñÌìͬÊÂÅöµ½Ò»¸öÎÊÌ⣬ʹÓÃJAVA MAILÊÕÈ¡Óʼþʱ£¬Èç¹ûÊÕ¼þÈËÊǸöÁÐ±í£¬ÇÒÊÕ¼þÈËÁбíÊÇÒԷֺŽøÐзָîµÄ£¬ÔòJAVA MAIL¾Í»á³öÏÖÒì³££¬²»ÄÜÕý³£½âÎö£¬³é¿Õ¿´ÁËÒ»ÑÛ£¬×Ô¼ºÐ´Á˸ö¼òµ¥demo£¬ºÜ¼òµ¥£¬ÀýÈ磺
@Test
public void testReceiveMail() {
try {
String host = "pop3.163.com";
Properties pops = new Properties();
pops.put("mail.pop3.host", host);
pops.put("mail.pop.auth", "true");
Session session = Session.getDefaultInstance(pops, null);
Store store = session.getStore("pop3");
//Á¬½ÓÓʼþ·þÎñÆ÷
store.connect(host, "chb_go", "3870359346");
//ÊÕÈ¡ÊÕ¼þÏä
Folder inbox = store.getDefaultFolder().getFolder("INBOX");
//Ö»¶Á×ã¹»ÁË
inbox.open(Folder.READ_ONLY);
//µÃµ½ËùÓÐÓʼþÁбí
Message[] msg = inbox.getMessages();
FetchProfile profile = new FetchProfile();
profile.add(FetchProfile.Item.ENVELOPE);
inbox.fetch(msg, profile);
for (int i = 0; i < msg.length; i++) {
System.out.println("===============================================");
System.out.println("Ö÷Ì⣺"+msg[i].getSubject());
InternetAddress[] toAddress = (InternetAddress[]) msg[i].getRecipients(Message.RecipientType.TO);
for(InternetAddress adress:toAddress){
System.out.println(adress.getAddress());
}
}
//¹Ø±Õ´ò¿ªµÄ
Ïà¹ØÎĵµ£º
ÇëÎʸ÷λ´ó룬Èç¹ûÓÃJAVAÀ´ÖÆ×÷¶¯Ì¬µÄ¸öÈËÍøÕ¾£¬¶¼ÐèÒªÄÄЩ·½ÃæµÄ֪ʶºÍ×¼±¸¹¤×÷£¿¿ª·¢¹¤¾ßʹÓÃʲô±È½ÏºÃ£¬Eclipse»¹ÊÇMyEclipse¡¢»¹ÊÇNetBeans£¿Çë¸ßÊÖÖ¸½Ì……
ÒÔǰÓÃEclipse×ö¹ý¹«Ë¾µÄÍøÕ¾£¬Ê±¼ä¸ôµÄÓÐЩ̫¾ÃÁË¡¢¶¼Íü¼ÇÊÇÔõÑùÒ»¸ö¹ý³ÌÁË¡£JSP¡¢SERLET¡¢HIBERNATE¡ ......
package tf;
public class TestPack {
public static void main(String [] args)
{
try
{
IAnimal cAnimal = new bird();
cAnimal.shout();
IAnimal animal =(IAnimal)java.lang.Class ......
Today , i take the first lesson of java ,let me sum up the details:
firstly,about jdk and jre.jdk stands for java development kit,while jre represent java Runtime Environment. jdk is the key of Java. And,jvm(java virtual machine) is the key of jre.
then ,about the platform independence of java.Dur ......
Ëæ×ŶàºË CPU µÄÈÕÒæÆÕ¼°£¬Ô½À´Ô½¶àµÄ Java Ó¦ÓóÌÐòʹÓöàÏ̲߳¢ÐмÆËãÀ´³ä·Ö·¢»ÓÕû¸öϵͳµÄÐÔÄÜ¡£¶àÏ̵߳ÄʹÓÃÒ²¸øÓ¦ÓóÌÐò¿ª·¢ÈËÔ±´øÀ´Á˾޴óµÄÌôÕ½£¬²»ÕýÈ·µØÊ¹ÓöàÏ߳̿ÉÄÜÔì³ÉÏß³ÌËÀËø»ò×ÊÔ´¾ºÕù£¬µ¼ÖÂϵͳ̱»¾¡£Òò´Ë£¬ÐèÒªÒ»ÖÖÔËÐÐʱÏß³Ì¼à¿Ø¹¤¾ßÀ´°ïÖú¿ª·¢ÈËÔ±Õï¶ÏºÍ¸ú×Ù Java Ïß³Ì״̬µÄÇл»¡£JDK 1.5 ¼°ÆäºóÐø°æ± ......