Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Delete emails(documents) from Lotus Notes inbox by using Perl

by facudy (Initiate)
on Jul 25, 2012 at 10:37 UTC ( #983614=perlquestion: print w/replies, xml ) Need Help??

facudy has asked for the wisdom of the Perl Monks concerning the following question:

Hi,I'm facing a issue while I was tring to delete emails(documents) from a Notes database by using the Perl.For example,I want to delete all the emails in my inbox view,how can I do it?Can you show me the codes? If you can resolve my problem,you can reply this posts or send an email to me -
  • Comment on Delete emails(documents) from Lotus Notes inbox by using Perl

Replies are listed 'Best First'.
Re: Downloading attachment from Lotus Notes via Perl script
by kcott (Bishop) on Jul 25, 2012 at 10:44 UTC

    '$FILE' is a string! $FILE is not interpolated within single quotes. Perhaps you want $doc->{$FILE}.

    -- Ken

      Hi, I tried to remove the single quotes,but it had a compile error:"Global symbol $FILE requires explicit package name".

        G'day facudy,

        Using incorrect quotes is a common problem we see here - hence my initial suggestion.

        If $FILE hasn't been exported (by a module you've used) and you haven't declared it (e.g. my $FILE = ...), then you will get that error message.

        I don't have Lotus Notes, so I can't actually test anything locally. However, here's some troubleshooting suggestions.

        In GetInfo(), you've commented out the Data::Dumper line. Uncomment this line to confirm (commented) output:

        The doc hash is $VAR1 = bless( {}, 'Win32::OLE' );

        Assuming this is correct, then $doc has no key/value pairs.

        On the next line you call $doc->Created. Call Dumper again after this line to see whether $doc is still empty.

        You then have some code that conditionally creates directories followed by a number of print TEXTFILE ... lines.

        In these print lines, you've referenced half a dozen keys: $doc->{Form} ... $doc->{Body}. Where did you get the names of these keys? Does the source of that information indicate anything like $doc->{Files} or $doc->{Attachments} (or even $doc->{'$FILE'})?

        Call Dumper $doc; again after close TEXTFILE; and see what's changed.

        Take a look at the messages.txt file you created. Does it look like what you expected?

        Is there a method $doc can invoke to get the attachment information (e.g. $doc->get_attachments();)?

        While doing the above tests, you may want to temporarily comment out the code after # Save attachments as files, if any.

        -- Ken

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://983614]
Approved by chacham
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-05-21 07:20 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (76 votes). Check out past polls.