使用MIME發送郵件通知

          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 明高 閱讀(163) 評論(0)  編輯  收藏


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


          網站導航:
           
          <2010年4月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678

          導航

          統計

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 黄浦区| 通州市| 儋州市| 句容市| 方山县| 大宁县| 泰和县| 淮滨县| 奉节县| 龙门县| 渭南市| 岚皋县| 石河子市| 尼勒克县| 谢通门县| 出国| 和田市| 尼木县| 定陶县| 内黄县| 股票| 洛扎县| 明光市| 张家口市| 鹿泉市| 武冈市| 营口市| 南涧| 德兴市| 芒康县| 正镶白旗| 枝江市| 紫金县| 横山县| 河北区| 方山县| 柳河县| 巴彦县| 贵溪市| 三门县| 昆山市|