Yes it is possible.
This is how I have done it in the past...

try this...

.
.
.
  use MIME::Lite;
  use Net::SMTP;
  
  ### Adjust sender, recipient and your SMTP mailhost
  my $from_address = 'Me';
  my $to_address = $email_addy;
  my $mail_host = "$mail_host";
  
  ### Adjust subject and body message
  my $subject = "$subject";
  my $message_body = "$RPTFILE attachment file";
  
  ### Create the multipart container
  $msg = MIME::Lite->new (
    From => $from_address,
    To => $to_address,
    Subject => $subject,
    Type =>'multipart/mixed'
  ) or warn "Error creating multipart container: $!\n";
  
  ### Add the text message part
  $msg->attach (
    Type => 'TEXT',
    Data => $message_body
  ) or warn "Error adding the text message part: $!\n";
  
  ### Add the ZIP file
  $msg->attach (
     Type => 'application/zip',
     Path => "$basedir/$RPTFILE",
     Filename => $RPTFILE,
     Disposition => 'attachment'
  ) or warn "Error adding $LOG: $!\n";
  
  ### Send the Message
  MIME::Lite->send('smtp', $mail_host, Timeout=>60);
  $msg->send;
 } 
.
.
.

David M. Funk 
President/CEO 
Tivoli Certified Enterprise Consultant 
Specializing in Network and Systems Management Solutions 
Trinity Solutions 
604 Cassandra Dr. 
Suite 204
Cranberry Twp., PA 16066 
Phone: 724-316-0721 
Fax:     724-772-7889 
email: [EMAIL PROTECTED] 
 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dax
Games
Sent: Tuesday, May 15, 2007 4:21 PM
To: [email protected]
Subject: File attachments via Perl using Net::SMTP


Is it possible to send SMTP mail with file attachments via Net::SMTP? if not how
can I do this.  I am sending SMTP messages successfully but need to send an
attached text file as well.

Thanks,

Dax
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to