Hi Mark, there was a really great tutorial on the "MyAdvisor" site by Matt Holthe showing how to create various types of MIME emails, however I don't think it exists on the web anymore. You can probably find some in the ddwiki or in the Notes 6 & 7 forum as well.
I'm not sure how or if you can generate a doc-link in MIME, but here's how you can generate a URL link (you should be able to instead use a "Notes://" link which would work like a doc-link in the Notes client instead of opening up the doc in a browser):
Dim body As NotesMIMEEntity
Dim mimeHeader As NotesMIMEHeader
Dim mimeChild As NotesMIMEEntity
dim stream As NotesStream
.... etc. ...
' - Generated URL to link to Request document should be of the format ...
' >> http://<server>/<dbPath>/<dbName.nsf>/$$OpenDominoDocument.xsp?documentId=<DocUNID>&action=openDocument
webAddr = Evaluate("@WebDbName",reviewDoc) ' = dbPath & nsf name in URL format with forward slashes
' - db.HTTPURL = URL command to open database ...
' - strip off the "/__<replicaID>?Opendatabase" to just leave the server URL "http://<server HTTP host name>"
urlLink = StrLeftBack ( db.HTTPUrl, "/" ) + "/" + webAddr(0) + "/$$OpenDominoDocument.xsp?documentId=" _
+ reviewDoc.ParentUNID(0) + "&action=openDocument"
If db.HTTPUrl = "" Then
urlLink = "http://localhost" + urlLink
End If
urlLinkText = "Click here to open Request: " + reviewDoc.RequestID(0)
... etc. ....
Set mimeHeader = body.CreateHeader({MIME-Version})
Call mimeHeader.SetHeaderVal("1.0")
Set mimeHeader = body.CreateHeader("Content-Type")
Call mimeHeader.SetHeaderValAndParams( {multipart/alternative;boundary="=NextPart_="})
' - Generate the HTML part of the email body next ...
Set mimeChild = body.createChildEntity()
Set stream = session.createStream()
.... (Set all your styles & addresing & the content of your email etc.) ....
Call stream.WriteText({<a href="} + urlLink + {">} + urlLinkText + {</a><br><br>})
Call stream.WriteText("<hr>")
Call stream.WriteText({<div style="font-size:9pt;text-align:center;">} + footerText + {</div>})
Call stream.WriteText("</body>", EOL_CRLF)
Call stream.WriteText("</html>", EOL_CRLF)
Call mimeChild.setContentFromText(stream, {text/html;charset="iso-8859-1"}, ENC_NONE)
Call stream.Close()
then send the email ...
Hope that helps,
Judy.