SnTT.gifI got this new customer that never had Lotus Notes before, but after seeing a demo, were convinced that I could write them an application, to good to be true. Which I did ;-)
Problem is that they want to keep on using Outlook for their mail client. Too bad: their loss, but my pain.
I built into most apps I develop means of creating a pre-filled email on the fly. Naturally, you create a maildoc in the users mail file, and off you go. Not this time however.
I had this brilliant idea: notesuiworkspace.UrlOpen opens a url based on the protocol:

  • http:// opens a browser;
  • notes:// opens a notes document/view/database;
  • mailto: would open an email !!
And it does. Great solution, completely cross platform, works even for Notes mails, but... it does NOT send it to the default mail-handler (Outlook in this case).
Weird, isn't it. It looks like Notes interpretes the URL passed to it, and seeing it's mailto: handles it itself, instead of passing it to the OS.
Damn. I was so proud of my simple solution (as mailto: has a rather flexible syntax).

I finally resorted to a solution I found over at DominoPower:
Different ways to programmatically create an email message.
It's a call to the windows api:
%INCLUDE "lsconst.lss"
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (Byval hwnd As Long, _
Byval lpOperation As String, Byval lpFile As String, Byval lpParameters As String, _
Byval lpDirectory As String, Byval nShowCmd As Long) As Long
Dim taskid As Long
Dim ingReturn As Long

The executable Lotus Script code is :
Sub MailTo(allAddr as string)
taskid = Getthreadinfo(LSI_THREAD_TASK_ID)
ingReturn = ShellExecute(taskid, "Open", "mailto:" + allAddr, "", "", 1)
end Sub

It does work, but it's no longer cross platform, nor elegant.
You got a better idea ?

Category:  Show-n-Tell Thursday  SnTT  | TechnoratiTechnorati: ,