Our company has been transitioning from Notes mail to Outlook for a little while. One of the hurdles for me has been getting Notes to send mail when the user no longer has a Notes mail file and also wants to send any editable emails via the Outlook client. Today, I’d like to have a look at my latest solution to opening those editable emails in the Outlook client.
If you try using @URLOpen or ws.URLOpen, you’ll find that despite having set the default email to Outlook, Notes insists on opening a Notes document to send the mail. If you put the mailto link into a browser, it opens in the default mail client, Outlook, formatted properly. If you programmatically open a http link, it opens in the default browser. Yet, frustratingly, it won’t take that same mailto link that works in the browser and open it from LotusScript or a formula. So, we have to cheat.
As a quick review, mailto links are actually very simple.
There are five components to the link, but none are required.
mailto:firstname.lastname@example.org Simply list the recipients email addresses. Outlook seems to prefer that you separate them with semi-colons, though most syntax guides suggest commas.
The other four are passed as parameters in the query string. So, before you use any of them, you have to use a question mark to separate the query string from the URL, then separate each parameter with an ampersand (&).
email@example.com or firstname.lastname@example.org You can add carbon-copy folks or blind-copy folks in the same way.
subject=That%20issue The subject line should be encoded so that there are no spaces and any unusual characters pass through to the email rather than disrupt the syntax of the query string.
body=The%20contents%20of%20email The body is, of course, the most important thing to us and we can simply compute the values to be used. Links back to Notes documents to be opened in the Notes client can even be used, so long as you provide a proper notes:// URL.
Hard coded example
So, all we have to do is generate the mailtoString, put it into a new HTML document and open it via NotesUIWorkspace.URLOpen to get our document to open and popup the Outlook client, populated with the correct information.