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


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


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

          導航

          統(tǒng)計

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 敦煌市| 恭城| 永丰县| 图们市| 广水市| 天等县| 太仆寺旗| 屏山县| 石楼县| 钦州市| 图片| 黎川县| 巴东县| 安平县| 资源县| 洱源县| 府谷县| 南宫市| 房山区| 石嘴山市| 贺兰县| 滦平县| 兴仁县| 阳西县| 宁津县| 介休市| 水富县| 乐昌市| 扬中市| 阿克陶县| 长武县| 富顺县| 化德县| 贵阳市| 鄂尔多斯市| 江口县| 唐山市| 宿迁市| 九江县| 江安县| 贵州省|