使用MIME發(fā)送郵件通知

          Sub SendMailNotification( docMain As Notesdocument, strSendto As String ,strTempletNum As String)
           On Error Goto ErrorHandle
           
           Dim docMail   As NotesDocument
           Dim rti    As NotesRichTextItem
           Dim body    As NotesMIMEEntity
           Dim child   As NotesMIMEEntity
           Dim stream   As NotesStream
           Dim strTmp   As String
           Dim strReplace  As String
           Dim bSuccess  As Boolean
           Dim strHtml  As String
           s.ConvertMIME   = False
           Set stream   = s.CreateStream
           
           Set docMail  = New NotesDocument(docMain.ParentDatabase) 
           Call docMail.ReplaceItemValue("Form","Memo")
           Call docMail.ReplaceItemValue("Principal","Reporter Notification")
           Call docMail.ReplaceItemValue("ReplyTo","")
           Set body   = docMail.CreateMIMEEntity("Body")
           Set child  = body.CreateChildEntity
           
           
           Call stream.WriteText(MailText(docMain,strTempletNum))
           Call docMail.ReplaceItemValue( "Subject",MailSubject(docMain,strTempletNum))   
           
           strHtml = |<br><div style="font-size:15px; "><b><a href="|&ProfileDoc.DBHome(0) & ProfileDoc.DBPath(0) & |/0/| & docMain.UniversalID &|?opendocument"  target="_blank">請點擊打開文檔</a></b></div>|
           stream.WriteText(strHtml)
           
           Call docMail.ReplaceItemValue("BlindCopyTo", strSendto)
           Call child.SetContentFromText(stream, "text/html;charset=GB2312", ENC_NONE)
           Call stream.Truncate
           Call docMail.Send(False)
           s.ConvertMIME = True  
           Call docMail.Remove(True)
           
           Exit Sub
          ErrorHandle:
           'iSuccess = False
           Messagebox db.FilePath & "_LSMailCommand.SendNotification:" & Error$ & " at line number " & Cstr(Erl) 
           Exit Sub
          End Sub

          posted on 2010-04-08 19:41 明高 閱讀(167) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          <2010年4月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 泰宁县| 光山县| 宜阳县| 定南县| 定襄县| 浦江县| 北票市| 大荔县| 福清市| 汤原县| 海伦市| 明光市| 河东区| 灵石县| 无极县| 泾阳县| 威远县| 蓬安县| 泽库县| 增城市| 缙云县| 镇宁| 施甸县| 阿拉善盟| 东海县| 洛南县| 黄山市| 荃湾区| 宁强县| 安徽省| 尖扎县| 阜南县| 瑞丽市| 金华市| 县级市| 隆昌县| 星座| 滁州市| 肥城市| 济阳县| 汝阳县|