All pastes #989133 Raw Edit

Anonymous

public text v1 · immutable
#989133 ·published 2008-04-18 04:09 UTC
rendered paste body
#!/usr/bin/perl
use Mime::Lite;
use Net::SMTP;

$to =shift;
#print $to;
$from = shift;
#print $from;
$subject = shift;
#print $subject;
$file2bsnt = shift;
#print $file2bsnt;
$file2bsnt=$file2bsnt2;
$message_body = "Regards, \nRe Alvarez";
$smtp_ip = '10.128.50.84';


  $msg = MIME::Lite->new (
    From => $from,
    To => $to,
    Subject => $subject,
    Type =>'multipart/mixed'
) or die "Wierd MIME Lite error: $!\n";

  $msg->attach (
    Type => 'TEXT',
    Data => $message_body
  ) or die "Error adding the text message part: $!\n";

  $msg->attach (
    Type => 'text/plain',
     Path => $file2bsnt,
     Filename => $file2bsnt2,
     Disposition => 'attachment'
  ) or die "Error adding $file2bsnt: $!\n";

  MIME::Lite->send('smtp', '10.128.50.84', Timeout=>60);
  $msg->send();
#print $!;