Hi Monks, is there a good way to add a result set that's stored in an array into the body of message in Outlook. I'm pulling data from a report each night and sending an email in the morning.

#!/usr/bin/perl -w use strict; use warnings; use POSIX; use Win32::OLE; open SOURCE, "< //reports/test.txt"; my $procdate = POSIX::strftime('%m/%d/%Y %H:%M', localtime); my @ies_details; my $Outlook = Win32::OLE->GetActiveObject('Outlook.Application') || Wi +n32::OLE->new('Outlook.Application'); #$Outlook = new Win32::OLE('Outlook.Application'); while(<SOURCE>) { my $source = $_; next if ($source =~ m/^(\s)*$/); next unless (substr($source,11,4) =~ m/(\d){4}/); if (substr($source,79,10) =~ /(\d){10}/) { push @ies_details,$source; } } my $test; foreach (@ies_details) { $test = $test . $_; }; my $mailitem = $Outlook->CreateItem(0); #Create mail Item unless ($mailitem) {die "Outlook is not running, cannot send mail. +\n";} $mailitem->{'To'} = 'test@yahoo.com'; $mailitem->{'Cc'} = 'test@test.com'; $mailitem->{'Subject'} = 'Summary Report ' . $procdate; $mailitem->{'Body'} = 'Below is a summary.' . "\n\n" . '-----------------------------------------' . "\n\n" . $test; $mailitem->{'Importance'} = 0; # 2=high, 1=normal, 0=low $mailitem->Send;

In reply to Add Results to Outlook body by drodinthe559

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.