Open Lotus Notes mail page without sending from .NET
I'd like to open a new email page, in Lotus Notes (I know I know, I hate it too...) from a WinForm (.NET) application. Right now, I have found this that uses Interop.Domino.dll very useful. I adapted it a little and it works. Unfortunately, I don't want the email to be sent. I just need to open a new mail window with the body I give it, but n开发者_JS百科o "To adress"...
I know Notes question don't have a high reply rate over here, but I give it a try anyway.
Thanks !
On Windows Notes clients greater than version 6, there is support for a Notes:\ URL scheme to launch documents. You can construct a URL dynamically in .Net that points to the user's mail database and opens a new mail form.
http://www.dominoguru.com/pages/LotusNotes_notesURLs.html has more details, but essentially it is of the form Notes:\server\database\0\memo?OpenForm
Any reason you can't just use a mailto
call in your code? Assuming that Lotus Notes is the registered mail handler on the client system, you should be able to pass in the body attribute and wot-not…
The Lotus Domino Objects (Interop.Domino.dll) don't have access to the Notes UI. You would need to use the deprecated, late-bound Lotus Notes Automation classes. Warning: they're crashy, which is one of the reasons they've been deprecated for more than ten years (since the release of Lotus Notes and Domino R5.0.2c).
I finally did use the mailto. Here the code :
Public Shared Sub OuvrirNouveauMessage(ByVal destinataire As String, ByVal sujet As String, ByVal corpsCourriel As String)
Dim sFile As String = "mailto:" & destinataire & _
"?subject=" & sujet & _
"?body=" & corpsCourriel
If sFile.Length > 2050 Then
sFile = sFile.Substring(0, 2050)
End If
System.Diagnostics.Process.Start(sFile)
End Sub
精彩评论