I am trying to compose a mail within a script and I am unable to utilize the @mailsend function. I cannot find an equivalent scripting function. We are running on version 4.63 here. I have come across some working code with "send_email" in it. This appears to be the correct functionality in that you can create the mail in the background and the user composing the original document never sees or interacts with the mail being sent. Unfortunately, the LotusScript compiler does not like the "send_email" command. Any ideas?
The method you need is the Send Method of the NotesDocument Class. The method has the format
Call notesDocument.Send( attachForm [, recipients ] )
Parameters attachForm Boolean. If True, the form is stored and sent along with the document. If False, it isn't. recipients String or array of strings. Optional. The recipients of the document, which may include people, groups, or mail-in databases. Ignored if the document contains a SendTo item, in which case the document is mailed to recipients listed in SendTo. Required if the document does not contain a SendTo item. --------------------------------------- If you are sending to a Notes client, it is also imioportant to set certain fields so the IsSummary property is true. If you don't do this, the values will not be displayed in the view. I've included a bit of LotusScript to populate a simple memo below. Either the SendTo or CopyTo field must be populated for the memo to be sent.
Dim item As NotesItem Dim docMemo as NotesDocument Dim rtiBody As NotesRichTextItem Dim db as NotesDatabase Dim session As NotesSession Set session = New NotesSession Set db = session.CurrentDatabase Set docMemo = New NotesDocument(db) Set item = New NotesItem(docMemo, "Form", "Memo") item.IsSummary = True Set item = New NotesItem(docMemo, "SendTo", "Your Reciipients Name Here") Set item = New NotesItem(docMemo, "CopyTo", session.CommonUserName) Set item = New NotesItem(docMemo, "Subject", "Your Subject goes here") item.IsSummary = True Set rtiBody = New NotesRichTextItem(docMemo, "Body") Call rtiBody.appendtext("The body of your message can be formatted using a richtext item. ") Call rtiBody.addnewline(2) Call rtiBody.appendtext("This will allow you to easily format the text with line breaks ") Call rtiBody.appendtext("and other formatting. You can even include links.") Call rtiBody.appenddoclink(db, "DB that generated this memo.") Call rtiBody.addnewline(1) Call docMemo.Send(False)
Dig Deeper on Domino Resources - Part 2
Related Q&A from Brian Mahoney
Find out what types of calculations can be computed for a column in a Lotus Notes view and the best way to go about it with this expert response. Continue Reading
Find out why you can't use Formula language to include a doclink to a specific Lotus Notes view or database and need to use LotusScript instead. Continue Reading
Discover the reasons behind a Notes/Domino admistrator having trouble with disabled options in the "customize this view" section of his Lotus Notes ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.