freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于java_mail的電子郵件收發(fā)系統(tǒng)畢業(yè)設(shè)計-資料下載頁

2025-08-18 15:31本頁面

【導(dǎo)讀】未定義書簽。未定義書簽。未定義書簽。未定義書簽。..15. 未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義書簽。未定義

  

【正文】 。 import .*。 import .*。 import .*。 import .*。 import .*。 /** * 有一封郵件就需要建立一個 ReciveMail 對象 */ public class ReceiveOneMail { private MimeMessage mimeMessage = null。 private String saveAttachPath = 。 // 附件下載后的存放目錄 private StringBuffer bodytext = new StringBuffer()。// 存放郵件內(nèi)容 private String dateformat = yyMMdd HH:mm。 // 默認的日前顯示格式 public ReceiveOneMail(MimeMessage mimeMessage) { = mimeMessage。 } public void setMimeMessage(MimeMessage mimeMessage) { = mimeMessage。 } /** * 獲得發(fā)件人的地址和姓名 */ 基于 Java Mail的電子郵件 收發(fā) 系統(tǒng)的設(shè)計與實現(xiàn) 第 33 頁 共 42 頁 public String getFrom() throws Exception { InterAddress address[] = (InterAddress[]) ()。 String from = address[0].getAddress()。 if (from == null) from = 。 String personal = address[0].getPersonal()。 if (personal == null) personal = 。 String fromaddr = personal + + from + 。 return fromaddr。 } /** * 獲得郵件的收件人,抄送,和密送的地址和姓名,根據(jù)所傳遞的參數(shù)的不同 to收件人 cc抄送人地址 bcc密送人地址 */ public String getMailAddress(String type) throws Exception { String mailaddr = 。 String addtype = ()。 InterAddress[] address = null。 if ((TO) || (CC) || (BCC)) { if ((TO)) { address = (InterAddress[]) mimeMessage .getRecipients()。 } else if ((CC)) { address = (InterAddress[]) mimeMessage .getRecipients()。 } else { address = (InterAddress[]) mimeMessage 基于 Java Mail的電子郵件 收發(fā) 系統(tǒng)的設(shè)計與實現(xiàn) 第 34 頁 共 42 頁 .getRecipients()。 } if (address != null amp。amp。 !()) { for (int i = 0。 i 。 i++) { String = address[i].getAddress()。 if ( == null) = 。 else { = ()。 } String personal = address[i].getPersonal()。 if (personal == null) personal = 。 else { personal = (personal)。 } String positeto = personal + + + 。 mailaddr += , + positeto。 } // mailaddr = (1)。 } } else { throw new Exception(Error addr type!)。 } return mailaddr。 } /** * 獲得郵件主題 */ 基于 Java Mail的電子郵件 收發(fā) 系統(tǒng)的設(shè)計與實現(xiàn) 第 35 頁 共 42 頁 public String getSubject() throws MessagingException { String subject = 。 try { subject = (())。 if (subject == null) subject = 。 } catch (Exception exce) { } return subject。 } /** * 獲得 郵件發(fā)送日期 */ public String getSentDate() throws Exception { Date sentdate = ()。 SimpleDateFormat format = new SimpleDateFormat(dateformat)。 if(sentdate!=null){ return (sentdate)。 } return 。 } /** * 獲得郵 件正文內(nèi)容 * * @throws Exception */ public String getBodyText(Message message) { try { 基于 Java Mail的電子郵件 收發(fā) 系統(tǒng)的設(shè)計與實現(xiàn) 第 36 頁 共 42 頁 getMailContent((Part) message)。 } catch (Exception e) { ()。 } return ()。 } /** * 解析郵件,把得到的郵件內(nèi)容保存到一個 StringBuffer 對象 中,解析郵件 主要是根據(jù) MimeType 類型的不同執(zhí)行不同的操作,一步一步的解析 */ public void getMailContent(Part part) throws Exception { String contenttype = ()。 int nameindex = (name)。 boolean conname = false。 if (nameindex != 1) conname = true。 if ((text/plain) amp。amp。 !conname) { ((String) ())。 ((String) ())。 } else if ((text/html) amp。amp。 !conname) { ((String) ())。 } } /** * 判斷此郵件是否需要回執(zhí),如果需要回執(zhí)返回 true,否則返回 false */ public boolean getReplySign() throws MessagingException { boolean replysign = false。 基于 Java Mail的電子郵件 收發(fā) 系統(tǒng)的設(shè)計與實現(xiàn) 第 37 頁 共 42 頁 String needreply[] = mimeMessage .getHeader(DispositionNotificationTo)。 if (needreply != null) { replysign = true。 } return replysign。 } /** * 獲得此郵件的 MessageID */ public String getMessageId() throws MessagingException { return ()。 } /** * 【判斷此郵件是否已讀,如果未讀返回返回 false,反之返回 true】 */ public boolean isNew() throws MessagingException { boolean isnew = false。 Flags flags = ((Message) mimeMessage).getFlags()。 [] flag = ()。 (flags39。s length: + )。 for (int i = 0。 i 。 i++) { if (flag[i] == ) { isnew = true。 (seen Message.......)。 break。 } } 基于 Java Mail的電子郵件 收發(fā) 系統(tǒng)的設(shè)計與實現(xiàn) 第 38 頁 共 42 頁 return isnew。 } /** * 判斷此郵件是否包含附件 */ public boolean isContainAttach(Part part) throws Exception { boolean attachflag = false。 if ((multipart/*)) { Multipart mp = (Multipart) ()。 for (int i = 0。 i ()。 i++) { BodyPart mpart = (i)。 String disposition = ()。 if ((disposition != null) amp。amp。 ((()) || (disposition .equals()))) attachflag = true。 else if ((multipart/*)) { attachflag = isContainAttach((Part) mpart)。 } else { String contype = ()。 if (().indexOf(application) != 1) attachflag = true。 if (().indexOf(name) != 1) attachflag = true。 } } } else if ((message/rfc822)) { attachflag = isContainAttach((Part) ())。 } 基于 Java Mail的電子郵件 收發(fā) 系統(tǒng)的設(shè)計與實現(xiàn) 第 39 頁 共 42 頁 return attachflag。 } /** * 【保存附件】 */ public void saveAttachMent(Part part) throws Exception { String fileName = 。 if ((multipart/*)) { Multipart mp = (Multipart) ()。 for (int i = 0。 i ()。 i++) { BodyPart mpart = (i)。 String disposition = ()。 if ((disposition != null) amp。amp。 ((()) || (disposition .equals()))) { fileName = ()。 if (().indexOf(gb2312) != 1) { fileName = (fileName)。 } saveFile(fileName, ())。 } else if ((multipart/*)) { saveAttachMent(mpart)。 } else { fileName = ()。 if ((fileName != null)
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1