The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 03-18-2009
SkySmart SkySmart is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 50
below is the code I came up with to get the file data.txt as an attachment and send it out:


Code:
sub test_mail {
my $msg = MIME::Lite->new(
   From    =>  'noreply@faroko.com',
   To      =>  'jamie.henson@faroko.com',
   Subject =>  'TESTING',
   Type    =>  'multipart/mixed',
);

$msg->attach(
    Type   =>  'TEST',
    Data   =>  "TESTING ATTACHMENT FEATURE",
);

$msg->attach(
    Type   =>   'TEST',
    Path   =>   'data.txt',
    Filename => 'data.txt',
);

$msg->send;
}


How can I incorporate this script into the existing script to have it send out the data.txt file to the email addresses.