Hi shylaja,
Welcome to the Monastery.
To read msg files from a particular folder, you need to open the folder see opendir, then open each msg file in the folder to read. Are the msg files just plain text files or not? You didn't say.
You can also look at using glob.
Please check How do I post a question effectively? to get the best help from around here. Once again welcome.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
| [reply] |
| [reply] |
#!/usr/bin/perl -Wl
use strict;
use Email::Outlook::Message;
for my $filename ( glob("$ARGV[0]*") ) {
## tell the filename reading
print 'Filename: ', $filename;
my $msg = new Email::Outlook::Message $filename;
my $mime = $msg->to_email_mime;
print $mime->as_string;
}
NOTE: I didn't link the Email::Outlook::Message, I only outlined it here. Others in this thread had it linked already.
And of course, your folder which contain these msg files must be the given from the CLI.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
| [reply] [d/l] |
| [reply] |
By 'folder' do you mean directory or a folder within Microsoft Outlook? Super Search will find you many threads discussing this problem.
| [reply] |