Friday, June 5, 2009

Mail from Outlook to Notes/Domino applications without Notes installed

I'm sorry to say that this post will be words only. No juicy code or bug ridden demo applications. Hopefully it will give you ideas on how to make use of this concept in your own applications.

Backstory: A customer of ours needed to get mails from Outlook into a Domino CRM web application. The prerequisite was that the users shouldn't need to install the Notes client.

This was presented to me by my boss over a couple of beers. I more or less immediately thought of the great functionality the Domino server has, that you can set up any NSF as the receiver of mails. If you could tag the mail with values inside Outlook, an agent could process the forwarded mails (add Readers/Authors fields based on customer id/etc.).

I started out with a POP3 Gmail account inside Outlook. I went through most of the writable properties of the mail-object, and struck gold. :)

The mail-object has a property called Category. When the mail is received inside Notes, this field is called Keywords. The field seems to be restricted to ASCII characters (or Gmail/Domino converts it to that). Therefore, the values need to be URL-encoded. From my small tests, everything seems to go through the wire. Line break, international characters, etc.

I send the values in a URL parameter pattern, so they're more readable, but formats like XML, CSV and JSON should work just as well. The only restriction I can think of is the ridiculous 32k limit on fields.

To let the user select the customer ID, I use the WebBrowser control inside a dialog in Outlook. The user interface is more or less a view with some DHTML code. When a user click a table row, I add a class on the row so that the user sees which customer is selected. I collect all the values from the selected table row, and put them inside a hidden field (comma separated). When the user clicks OK in the Outlook-dialog, I use VBA to collect the values from the hidden field. A second dialog is used for some custom fields (document type, date and description). That's about it.

Share and enjoy!

0 comments: