javamail收到邮件后,如何查看邮件的原始信息.
如下:
Received: from 21cn.com([59.36.102.12]) by 21cn.com(AIMC 3.1.0.0)
with SMTP id jmc457855c4; Thu, 07 Dec 2006 19:31:36 +0800
Received: from aisp3-smtp (unknown [202.105.45.9])
by 21cn.com (HERMES) with ESMTP
for <[email protected]>; Thu, 7 Dec 2006 19:39:22 +0800 (CST)
Received: from supperken([61.140.250.70])
by aisp3-smtp(Knowledge-based Antispam Gateway 2.113) with ESMTP id local14686.1165490183 for <[email protected]>;
Thu, 07 Dec 2006 19:16:23 CST
X-Original-AuthLogin: [email protected]
Date: Thu, 7 Dec 2006 19:33:57 +0800
From: "ken" <[email protected]>
To: "heng2-py" <[email protected]>
Subject: test
Message-ID: <[email protected]>
X-mailer: Foxmail 6, 5, 104, 21 [cn]
Mime-Version: 1.0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: 7bit
X-AIMC-AUTH: heng-py
X-AIMC-MAILFROM: [email protected]
X-AIMC-Msg-ID: UX43RsQB
如下:
Received: from 21cn.com([59.36.102.12]) by 21cn.com(AIMC 3.1.0.0)
with SMTP id jmc457855c4; Thu, 07 Dec 2006 19:31:36 +0800
Received: from aisp3-smtp (unknown [202.105.45.9])
by 21cn.com (HERMES) with ESMTP
for <[email protected]>; Thu, 7 Dec 2006 19:39:22 +0800 (CST)
Received: from supperken([61.140.250.70])
by aisp3-smtp(Knowledge-based Antispam Gateway 2.113) with ESMTP id local14686.1165490183 for <[email protected]>;
Thu, 07 Dec 2006 19:16:23 CST
X-Original-AuthLogin: [email protected]
Date: Thu, 7 Dec 2006 19:33:57 +0800
From: "ken" <[email protected]>
To: "heng2-py" <[email protected]>
Subject: test
Message-ID: <[email protected]>
X-mailer: Foxmail 6, 5, 104, 21 [cn]
Mime-Version: 1.0
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: 7bit
X-AIMC-AUTH: heng-py
X-AIMC-MAILFROM: [email protected]
X-AIMC-Msg-ID: UX43RsQB
解决方案 »
- String怎么替换"\"
- 根据字符串值(String str1 ="1=1";),把其看做布尔表达式,得到true或false。
- jdk中JAR文件应用问题
- "a|b".split("|").length
- 求数字大小写转换的java程序
- 高手进来~鼠标监听器怎么实现的?
- 关于SWING换外观的高手级别问题. 界面达人请进!
- 日期问题:String="200602",求增加月份,得到结果 String 类型 200603这样的结果
- 请问从哪里能下到java的详细的帮助~
- SOS:关于Visual age for java!高分伺候!
- 技术难题 高手请进
- 请问如何制作jar可执行文件?请高手赐教!
+ "\t" + message[i].getSubject());应该在Message这个类里面有。
GetAllHeader()或者GetAllHeaderLines()得到头信息。
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
ByteArrayInputStream bais;
InternetHeaders iheader; try{
this.messages[index].writeTo(baos); //baos存放了所有的原始信息(包括邮件头),可以用toString取得
bais = new ByteArrayInputStream(baos.toByteArray());
iheader = new InternetHeaders(bais);//iheader就是邮件头 }
catch(Exception e) {
e.printStackTrace();
}
} //End showOrgHeader