The link works because the recipient's mail program recognizes the URL syntax within the message text and makes it an active link when it displays it.
I'm not sure what programming language you're working in. I'm going to assume LotusScript.
When converting a message that contains just text to Internet format (MIME), Domino doesn't treat the text as HTML. Instead, it assumes that if the text contains a >, you want the recipient to see a <. So it "escapes" the >, changing it to <, so that the receiving e-mail program doesn't mistake it for HTML and try to interpret it as a tag.
There are a few ways to tell the Domino mail gateway that you really intended to use HTML in your message. One is to not use HTML, but instead use the corresponding rich text entities. This works great if you wanted to set the color, font or style of text. Unfortunately, there's no support with the rich text APIs in LotusScript or Java to create URL links. You can use NotesRichTextStyle.PassThruHTML property to designate certain parts of your message as HTML code. However, I'm not certain that the mail gateway pays attention to this setting.
From a developer's perspective, an easier way is to manually create the exact rich text you want to send and store it in a Notes document somewhere -- a configuration document for your application. You can use a profile document for this or a "normal" document. That lets you use Create / Hotspot / Link Hotspot to make the URL link. In the agent that sends the e-mail, use the NotesDocument object to retrieve this configuration document, GetFirstItem to retrieve the rich text field containing the URL link, and either CopyItem or AppendRTItem to move the rich text into the message that you're creating. The Domino Designer 6 Redbook contains an example of this technique in the chapter on rich text programming.
Another way is to bypass the rich text to MIME conversion by using MIME yourself in the first place. I just wrote an article about this, entitled Using HTML, MIME and LotusScript to jazz up messages and reports. If you're not a subscriber to The View (the publication it appeared in), you can still download the sample database and try it out (Create / MIME code generator). Here's some sample source code it generated for a simple message, including a URL link:
Set result = doc.CreateMIMEEntity("Body") Dim hdr As NotesMimeHeader ' text entity, encoding type ENC_NONE Dim stream As NotesStream Dim session As New NotesSession Set stream = session.CreateStream stream.WriteText(|
Please take our annoying survey! Clickhereto begin. |) result.SetContentFromText stream, "text/html", ENC_NONE Call doc.CloseMIMEEntities(True, "Body") ' finalize pending changes into the document.
Do you have comments on this Ask the Expert question and response? Let us know.
Dig Deeper on LotusScript
Related Q&A from Andre Guirard
Learn how you can use LotusScript and OLE to create and populate Microsoft Excel spreadsheets, as well as a little bit about Lotus Symphony. Continue Reading
Discover options you can use if you'd like external users to be able to access a workflow-based Notes Domino application through different ... Continue Reading
Learn why you may receive the error message: "Illegal circular use: Audit Trail" when trying to open Lotus Notes documents that use copied forms. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.