@MailSend using script

Is there an equivalent for @MailSend in the Notes Script?

Subject: @MailSend using script

doc.send in the NotesDocument class

Be sure to include a couple of additional lines:

doc.form = “Memo”, or else when the msg is sent it can be displayed in a mail file and

doc.sendto to be sure it gets somewhere

most other fields are optional

In my experience this method works well using both notes names and full email addresses in case you need to send something over the web - whereas in cases I have seen that @mailsend doesn’t work for internet addresses.

hope this helps

Subject: RE: @MailSend using script

Does that mean I have to have a “Memo” form in my db? So far I have this:

@If(@IsNewDoc;

@If(SA != “”; @MailSend(SATeam ; “” ; “” ; “Blah-blah-blah” ; “Blah-blah-blah”; "To open the request follow this link → "; [IncludeDoclink]); “”);

“”)

How should the script look?

Subject: @MailSend using script

Check the notes document class in the help file. Here are all the examples from it:

  1. This script mails a document and its form. The document is mailed to the recipients contained in the SendTo item of the document.

Dim doc as NotesDocument

'…set value of doc…

Call doc.Send( True )

  1. This script sets the value of the SendTo item in a document. It then mails the document and its form. The document gets mailed to Carl Pycha.

Call doc.ReplaceItemValue( “SendTo”, “Carl Pycha” )

Call doc.Save( False, True )

Call doc.Send( True )

  1. This script mails a document to Sally Bowles. The form is not mailed.

Call doc.Send( False, “Sally Bowles” )

  1. This script mails a document and its form to Jim Dinauer, Betty Dinauer, and Mary Sticka.

Dim recipients( 1 To 3 ) As String

recipients( 1 ) = “Jim Dinauer”

recipients( 2 ) = “Betty Dinauer”

recipients( 3 ) = “Mary Sticka”

Call doc.Send( True, recipients )

  1. This script mails a document to anyone listed in its DocAuthor field.

Call doc.Send( True, doc.DocAuthor )

  1. This script creates a new document in the current database and mails it to Elissa Minty.

Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Set db = session.CurrentDatabase

Set doc = New NotesDocument( db )

doc.Form = “Memo”

doc.SendTo = “Elissa Minty”

doc.Subject = “Here’s the document you wanted”

Call doc.Send( False )