1
votes

I am trying to send email from Lotus Script. But the email doesn't seem to have the FORM ( named Email Form , referred below in the code ) attached to it, when received in the inbox.

When I check the Document property in the email, it says the form is "Memo" and the FROM, TO addresses are Blank.

I have defined the FROM, TO,SUBJECT,BODY fields in the Email Form in a specific format .

But all these field values are populated correctly in the form. Issue happens only after send .

The Same code works fine in some other Lotus Notes, when the email is triggered by another person, having a different Notes ID configured in that system . Not sure if this is code issue, or Lotus Notes configuration issue .

Any help to solve this would be greatly appreciated . The for has the property " Store Form in Doc" set and even ComputeWithForm returns success .

Could this be a problem with my Lotus notes settings/configuration? .Same code sends email in correct format in some other system configured wit their Notes ID

Here is a sample code on the EMAIL Action button

Sub Click(Source As Button)
      Set email = db.CreateDocument
      Call email.ReplaceItemValue("Form", "Email Form")      
      Call email.ReplaceItemValue("Subject", " My TestEmail")
      Call email.ReplaceItemValue("From", nom.Canonical)      
      Call email.ReplaceItemValue("SendTo", nom.Canonical)
      Call email.ReplaceItemValue("Body", " Hello, my test email ")
      Call email.Send(True,nom.Common)
End Sub
2

2 Answers

3
votes

It seems you mixed syntax here, you both set SendTo and specify nom.common, only one should be done. As in the help you should use:

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
doc.Form = "Email Form"
doc.SendTo = "Elissa Minty"
doc.Subject = "Here's the document you wanted"
Call doc.Send( true ) 'true here means you the form is stored and sent along with the document.

Now, check that you "Allow use of stored forms in this database." in your DB, could it be that this code exists in differents DBs and one doesn't have "Email Form" ? BTW check is it really "Email Form" and not "Email" ?

You may need also to check the local configuration on the client. To do this refer to Help.

0
votes

Its not that complicated to send mails usually, with docs from a Mail Enabled database. But now you have added a more complicated solution, than necessary, you may want to review your solution, to save yourself of future problems. You won't even need to LotusScript this, provided the Mail fields (SendTo as minimum) is there on the document.

See here how:

Designer 8.5.3 Help - Setting up automatic mailing