Hi All, I am trying to print out diff results in the body of a mail message, but for some reason I am only able to get the contents of the MSG to print... Any suggestions would be greatly appreciated. Here's the script:

@rem = ' PERL for Windows NT - ccperl must be in search path @echo off ccperl %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl @rem '; use Net::SMTP; my $smtp; my @typeCmdOut; my $type; my @cmdOut; my $cmd; $CLEARCASE_COMMENT=$ENV{CLEARCASE_COMMENT}; $ELEM_NAME=$ENV{CLEARCASE_PN}; @typeCmdOut = "cleartool describe -fmt \"\%[type]p\" $ELEM_NAME"; chomp ( @typeCmdOut ); $type = @typeCmdOut[0]; #if ($ELEM_NAME=~m/txt/) if ( $type =~ m/text_file/ ) { # create command string # change command string \ to / globally # run the command, capturing the results in an array # $cmd = "cleartool diff -pred -serial " . $ELEM_NAME; $cmd = "cleartool diff -pred -serial $ELEM_NAME"; # $cmd =~ s/\\/\//g; @cmdOut = `$cmd`; } my @MSG = ("Trigger activation mail notification for controlled action on VOB ($ +ENV{'CLEARCASE_VOB_PN'}): User: $ENV{'CLEARCASE_USER'} Operation: $ENV{'CLEARCASE_OP_KIND'} Element: $ENV{'CLEARCASE_PN'} Version: $ENV{'CLEARCASE_ID_STR'} Comment: $ENV{'CLEARCASE_COMMENT'}\n"); $smtp = Net::SMTP->new('mail.xxx.com'); $smtp->mail('xxx'); $smtp->to('xxx'); $smtp->data(); $smtp->datasend("TO: xx\xx\n"); $smtp->datasend("Subject: Diffrences\n"); #foreach (@cmdOut) #{ # $smtp->datasend($_); #} $smtp->datasend(@MSG); $smtp->datasend($cmd); $smtp->dataend(); $smtp->quit; __END__ :endofperl

Thanks very much, uriashea

Code tags added by Arunbear


In reply to Diff Result Mail Output by uriashea

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.