Venerable Monks, I'm trying to send email through Lotus Notes with multiple SendTo, CopyTo and/or BlindCopyTo recipients with code such as this:
#!perl -w use strict; use Win32::OLE; my $servername = 'NOTES1/CORPSERVER'; #your server name here # my $db_path = 'mail\ltcrepor.nsf'; #your mail database here # my $pw = 'LTCREPORTS'; #your password here my $db_path = 'mail\dbase.nsf'; #your mail database here my $pw = 'password'; #your password here my $Notes = Win32::OLE->new('Lotus.NotesSession') or die "Can't get NotesSession object.\n"; $Notes->Initialize($pw); my ($Version) = ($Notes->{NotesVersion} =~ /\s*(.*\S)\s*$/); my $User = $Notes->{UserName}; my $Platform = $Notes->{Platform}; my $Database = $Notes->GetDatabase($servername,$db_path) or die "Cannot access database"; my $Document = $Database->CreateDocument; $Document->AppendItemValue ("Form", "Memo"); # ***MULTIPLE RECIPIENTS SHOULD BE AN ARRAY OF STRING ELEMENTS*** my @recipients = ('cat@hat.com', 'rush@gasbag.org'); print @recipients; $Document->AppendItemValue ("SendTo", @recipients); $Document->AppendItemValue ("Subject", "Lotus Notes email from Perl sc +ript"); my $Filename = "C:\\OLEnotes.txt"; my $Body = $Document->CreateRichtextItem('Body'); $Body->AppendText(<<"EOT"); This here is the body text of the email. Kind regards, Mary EOT $Body->EmbedObject (1454, "", $Filename, "Attachment"); $Document->Send(0);
That code yeilds this error message:
Win32::OLE(0.1403) error 0x8002000e: "Invalid number of parameters" in METHOD/PROPERTYGET "AppendItemValue" at this_sends_lotus_email. +pl line 30 OLE exception from "NotesDocument": No recipient list for Send operation Win32::OLE(0.1403) error 0x80041048 in METHOD/PROPERTYGET "Send" at this_sends_lotus_email.pl line 54
Referring to THIS LINK, multiple recipients must be in an array of string elements. How can I accomplish this in Perl? Humbly yours, Bukharik

In reply to Lotus Email: Multiple Recipients by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.