Links and MimeEntities

I am running into a problem and am wondering if anyone out there has done something similar that I might be able to steal learn from.  The issue is being caused by Outlook's/Exchange's handling of long URLs.  My standard notification library has the ability to add a URL link to the document at the bottom of the notification.  Since these are Domino URLs, they tend to be very long.  When I open up the links in Outlook, they are wrapped after a certain number of characters and the link no longer works.

I know that you can use the MimeEntity class to spit out HTML for email messages, so I looked into using it for this problem.  Unfortunately, all the examples I found deal with creating the email completely from scratch.  My workflow solution allows database managers to write Rich Text notification templates that are used to pull data from the document that is being processed.  This works very well and it is not something that I am going to be able to easily give up.  In a nutshell, here is what I want to happen:

  1. Get a handle on the notification template document.
  2. Create a new document based on the template.
  3. Replace all of the values on the template with values from the document being processed.
  4. Depending on a variable on the template form, append either HTML, a URL, or doclink to the notification.
  5. Send notification.

The HTML I want to append in #4 is a simple Click Here to access the document. Nothing special, right?  Well, the problem comes when I try to access the RichTextField on the document and treat it like a MimeEntity.  If I try to create a new MimeEntity with the same name, it gives me an error like I would expect, but it won't let me access the existing field and create a child entity to it.  Am I going down the wrong path or is there something simple I am missing? 

Here is some of code in question:

If mail.AppendLink(0) = "URL" Then
  Call body.AppendText(urltext)   
 Elseif mail.AppendLink(0) = "Doclink" Then
  Call body.AppendText("Click here to access the document -->")
  Call body.AppendDocLink(doc,"Link to document")
 Elseif mail.AppendLink(0) = "URL Link" Then
  session.ConvertMime = False
  Set stream = session.CreateStream
  Set mime = mail.CreateMIMEEntity
  Call stream.WriteText(|

Click here to access the document|)
  Call mime.SetContentFromText(stream,"text/html",ENC_NONE)
  Call mail.CloseMIMEEntities(True)
 End If

Any help at all would be appreciated.

<< Previous Document / Next Document >>
  • 1) Short URL Links to Notes Docs - Kevin Pettitt
    Created 2/13/2006 2:02:01 PM email | website

    Sean, if I understand correctly, you just need to drop url links into a notes memo body that don't wrap when the email is plain text.

    Assuming that is correct, this can be accomplished quite easily by creating a 1-column view with all docs sorted by some unique id (not the UNID - too long). Give the view a short alias (e.g. "id"). Finally, construct the url like so:

    www.phigsaidwhat.com/folder/db.nsf/id/uniqueid

    Hope that helps.

    Kevin

  • 2) Re: Short URL Links to Notes Docs - Sean Burgess
    Created 2/13/2006 2:22:26 PM email | website

    Excelled idea Kevin. I guess I have gotten spoiled lately working in environments with Notes mail, so I had to think of all the work arounds. I would still like to be able to get it working "correctly" using the MimeEntity classes. But if I have to cheat, I have to cheat.

    Sean---


Discussion for this entry is now closed.