I'm trying to grab variables from a license file, then grab all of those values and place them into a single email with the information listed as such: $keyname $keyexpr $keycount $keyavailable $keyname $keyexpr $keycount $keyavailable $keyname $keyexpr $keycount $keyavailable...etc. When I do this with the existing code it sends the correct data, but only one line per email. What am I doing wrong, and is there a better way to do this?

### RETRIEVE LICENSE DETAILS ######################################### +########## my @keylist = (); # Application returned license list (limited to Ar +rayMax elements) # call APP SOAP APP_SystemKeys method with required parameters my $vpsxkeylist = $soap->VPSX_SystemKeys( SOAP::Data->type('string')->name('SessID')->value($session +ID), SOAP::Data->type('string')->name('VPSID')->value($vpsx), ); # catch errors if ( $appkeylist->fault ) { print "\t* ERROR RETRIEVING VPSX KEYS: INVALID VPSX_SystemKeys + PARAMETERS\n\n"; if ($log ne "") { $datestring = localtime(); print LOGFILE "* ERROR RETRIEVING APP KEYS: INVALID APP_Sy +stemKeys PARAMETERS\n"; print LOGFILE "$datestring\n"; } exit(4); } else { print "\n\tPRODUCT EXPIRATION T +OTAL AVAILABLE\n\n" if (!$hidestdout); print LOGFILE "\t\tPRODUCT EXPIR +ATION TOTAL AVAILABLE\n" if ($log ne ""); @keylist = @{ $appkeylist->result }; foreach my $key (@keylist) { my $keyname = $key->{Name}; my $keyexpr = $key->{Expiration}; my $keycount = $key->{Count}; my $keyavailable = $key->{Available}; if ($keycount == "-1") {$keycount = "UNLIMITED"}; if ($keyavailable == "-1") {$keyavailable = "UNLIMITED +"}; $keyname = sprintf("%-32s", $keyname); $keyexpr = substr($keyexpr,0,10); $keycount = sprintf("%-9s", $keycount); $keyavailable = sprintf("%-9s", $keyavailable); print "\t$keyname $keyexpr $keycount $keyavailable\ +n" if (!$hidestdout); print LOGFILE "\t\t$keyname $keyexpr $keycount $key +available\n" if ($log ne ""); if ($debug and !$hidestdout) { $smtp = Net::SMTP->new($mailhost, Debug => 1); } else { $smtp = Net::SMTP->new($mailhost); } eval { $smtp->mail($mailfrom) || die("$!\n"); if ($smtp->to(split(/,/, $mailto))) { $smtp->data(); $smtp->datasend("Subject: License File Sta +tus Report\n"); $smtp->datasend("\n"); + $smtp->datasend("\t \n"); $smtp->dataend(); } else { print "\tERROR SENDING EMAIL, RUN WITH DEB +UG FOR MORE INFO: ", $smtp->message(); print "\tCHECK MAIL KEYWORDS: mailhost=$ma +ilhost | mailfrom=$mailfrom | mailto=$mailto\n\n"; print LOGFILE "ERROR SENDING EMAIL, RUN WI +TH DEBUG FOR MORE INFO: ", $smtp->message() if ($log ne ""); print LOGFILE " RUN WITH DEBUG, CHECK MAI +L KEYWORDS: mailhost=$mailhost | mailfrom=$mailfrom | mailto=$mailto\ +n" if ($log ne ""); } }; if ($@) { print "\tERROR SENDING EMAIL, RUN WITH DEBUG F +OR MORE INFO\n"; print "\tCHECK MAIL KEYWORDS: mailhost=$mailho +st | mailfrom=$mailfrom | mailto=$mailto\n\n"; print LOGFILE "ERROR SENDING EMAIL, RUN WITH D +EBUG FOR MORE INFO\n" if ($log ne ""); print LOGFILE " CHECK MAIL KEYWORDS: mailhost +=$mailhost | mailfrom=$mailfrom | mailto=$mailto\n" if ($log ne ""); } } $smtp->quit; }

In reply to Sending an email of compiled data by Superbroom2.0

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.