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