Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple Recipients in Lotus Notes
Message
From
18/12/2001 14:55:08
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00595660
Message ID:
00595767
Views:
16
>>I'm trying to send emails from a VFP program using Lotus Notes. I have the following code which works fine when sending to one recipient.
>>
>>
>>
>>loNotes = CreateObject("Lotus.Notessession")
>>loNotes.initialize("myPassword")
>>loDBDir = loNotes.GetDBDirectory("")
>>loDb = loDBDir.OpenMailDatabase()
>>loDoc = loDb.CreateDocument
>>
>>lcSubject = "Test Message"
>>lcBody = "Body of Test Message"
>>lcRecipient = "Recipient"
>>		
>>loDoc.ReplaceItemValue("Subject", lcSubject)
>>loDoc.ReplaceItemValue("Body", lcBody)
>>loDoc.ReplaceItemValue("SendTo", lcRecipient)
>>loDoc.Send(.F.)
>>
>>
>>
>
>Rich,
>Message#391216 shows an exmple of using the AppendItemValue method of the SendTo NotesItem to handle multiple addresses. One minor change to the code I would add if using VFP 7, would be to use Alines() to break out the addresses and parse the array instead of the string approach. Either way, it would work.
>
>HTH.

Thanks for pointing me to this thread. Interesting reading from which I learned a bit.

From another source it turned out that one of my earlier tries (one not included in my original message) actually worked, but that my testing was inaccurate. You can pass an array to ReplaceItemValue() rather than Send(). My problem was that I assumed sending multiple copies to one address was valid. Apparantly, Notes will send only to unique addresses. When only one copy arrived I assumed (there's that word again) that it was because only the first array item was processed.

At any rate
loDoc.ReplaceItemValue("SendTo", @acRecipients)
did the trick.

Thanks for your tip on ALINES(). In VFP 6 I can CHRTRAN() a semi-colon into a CR. It makes the parameter passing a lot easier for me.

........Rich
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform