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

正文內(nèi)容

基于javagui的電子郵件客戶端軟件的設(shè)計與實現(xiàn)(doc畢業(yè)設(shè)計論文)(編輯修改稿)

2024-07-15 14:30 本頁面
 

【文章內(nèi)容簡介】 if(().length()==0 || ().length()==0 || ().length()==0) return false。 else if(hasSMTPAuth){ if(().length()==0) return false。 else return true。 }else{ return true。 } } private void reEncode(){ if(()==BIG5){ = toBIG5(mailFrom)。 = toBIG5(mailTo)。 = toBIG5(mailTitle)。 = toBIG5(mailBody)。 }else if(()==UTF8){ = toUTF8(mailFrom)。 = toUTF8(mailTo)。 = toUTF8(mailTitle)。 = toUTF8(mailBody)。 } }private String toUTF8(String str){ try { str = (str,UTF8, B)。 return str。 } catch (Exception ex){ return str。 } } } 新建郵件 要發(fā)送郵件之需要使用已經(jīng)建好的sendMail類即可,功能代碼如下: sendMail mail=new sendmail()。 (****)。 (****)。 mailsend()。4 . 郵件附件的功能實現(xiàn) 此功能實現(xiàn)代碼如下: public class AttachExample { public static void main (String args[]) throws Exception { String host = args[0]。 String from = args[1]。 String to = args[2]。 String fileAttachment = args[3]。 // 獲得系統(tǒng)參數(shù) Properties props = ()。 //設(shè)置郵件的服務(wù)器 (, host)。 // 獲得Session Session session = (props, null)。 MimeMessage message = new MimeMessage(session)。 // Define message (new InternetAddress(from))。 (,new InternetAddress(to))。 (Hello JavaMail Attachment)。 MimeBodyPart messageBodyPart =new MimeBodyPart()。// create the message part (Hi)。//fill message Multipart multipart = new MimeMultipart()。 (messageBodyPart)。 // Part two is attachment messageBodyPart = new MimeBodyPart()。 DataSource source = new FileDataSource(fileAttachment)。 (new DataHandler(source))。 (fileAttachment)。 (messageBodyPart)。 // 將多個附件加入信件中 (multipart)。 // 發(fā)送帶附件的郵件,此功能代碼結(jié)束 ( message )。 }4 . 收取郵件功能的實現(xiàn) 郵件的收取可以使用java Mail API的方法,主要的操作過程為:。(INBOX)。(潛在地)優(yōu)化對特定郵件組成成分的提取。,其目的是更有效地實現(xiàn)郵件組成成分的預(yù)提取 此功能的主要代碼如下: String pers = null。 String addr = null。 if(a instanceof InternetAddress amp。amp。((pers=((InternetAddress)a).getPersonal())!=null))addr=pers+ ++((InternetAddress)a).getAddress()+。 elseaddr = (); return addr。 Session mailsession=((),null)。 (false)。 Store store=(protocol)。//protocol為連接協(xié)議,IMAP或是POP (mailhost,1,user,passwd)。//mailhost主機(jī),user為用戶名,passwd為密碼 Folder folder = (INBOX)。try { ()。} catch (MessagingException ex) { ()。 } Message message[]=()。 FetchProfile fp=new FetchProfile()。 ()。 ()。 (XMailer)。 (message,fp)。 int id=0,j=0。 for(int i=0。i(id).length()。i++)//假設(shè)要閱讀第ID個郵件。 id=id*10+((id).charAt(i)48)。 for(j=0。jid。j++)。message[j].setFlag(,true)。 (“主題:”+message[j].getSubject())。 String from=new String()。Address[] fr=message[j].getFrom()。if(fr!=null){ boolean tf=true。 for(int i=0。i。i++) from=from+getDisplayAddress(fr)。}(“from”+from+)。Object o=message[j].getContent()。if (message[j].isMimeType(text/plain)) //就可直接讀出了。 ((String)o+ )。 else if(message[j].isMimeType(multipart/*)){ Multipart mp=(Multipart)o。Part part=(0)。String msg=(String)()。StringBuffer buf=new StringBuffer(()+6)。char ch=39。 39。for(int i=0。i()。i++)//若遇到換行就轉(zhuǎn)為br{ ch=(i)。if(ch==39。\n39。)(br)。else (ch)。}(())。}else(現(xiàn)在還無法顯示:+message[j].getContentType())。 (true)。 ()。 String pers = null。String addr = null。if(a instanceof InternetAddress amp。amp。((pers=((InternetAddress)a).getPersonal())!=null))addr=pers+ ++((InternetAddress)a).getAddress()+。elseaddr = ();return addr。Session mailsession=((),null)。(false)。Store store=(protocol)。//protocol為連接協(xié)議,IMAP或是POP(mailhost,1,user,passwd)。//mailhost主機(jī),user為用戶名,passwd為密碼Folder folder = (INBOX)。try { ()。} catch (MessagingException ex) { ()。 }Message message[]=()。FetchProfile fp=new FetchProfile()。()。()。(XMailer)。(message,fp)。int id=0,j=0。for(int i=0。i(id).length()。i++)//假設(shè)要閱讀第ID個郵件。 id=id*10+((id).charAt(i)48)。for(j=0。jid。j++)。 message[j].setFlag(,true)。(“主題:”+message[j].getSubject())。String from=new String()。Address[] fr=message[j].getFrom()。if(fr!=null){ boolean tf=true。 for(int i=0。i。i++) from=from+getDisplayAddress(fr)。}(“from”+from+)。Object o=message[j].getContent()。if (message[j].isMimeType(text/plain)) //就可直接讀出了。 ((String)o+ )。 else if(message[j].isMimeType(multipart/*)){ Multipart mp=(Multipart)o。Part part=(0)。String msg=(String)()。StringBuffer buf=new StringBuffer(()+6)。char ch=39。 39。for(int i=0。i()。i++)//若遇到換行就轉(zhuǎn)為br{ ch=(i)。if(ch==39。\n39。)(br)。else (ch)。}(())。}else(現(xiàn)在還無法顯示:+message[j].getContentType())。 (true)。 ()。 在Folder對象中可以用getMessageCount()和getUnreadMessageCount()方法來取得總共有多少封信和共有多少封信未讀。 但是如果我們需要在我們的java項目中增加對Hotmail郵箱(此郵箱有一個限制就是它并不提供POP3或者SMTP服務(wù),也就是說一般的郵件客戶端工具無法使用這個郵箱)的支持,那往往會不知從什么地方開始入手,因為SUN公司提供的java mail本身并不提供對
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1