in reply to Emailing ZIP Attachment
#!/usr/bin/perl use warnings; use strict; use MIME::Lite; $MIME::Lite::AUTO_CONTENT_TYPE = 1; #-- create the multipart container my $msg = MIME::Lite->new ( From => $query->param('fromwho'), To => $_, Subject => $query->param('subject'), Type =>'multipart/mixed' ) or die "Error creating multipart container: $!\n"; #-- add the text message part $msg->attach ( Type => 'TEXT', Data => $query->param('message'), ) or die "Error adding the text message part: $!\n"; #-- add the ZIP file $msg->attach ( Type => 'AUTO', Path => "../".$file, Filename => $file, Disposition => 'attachment' ) or die "Error adding $file: $!\n"; $msg->send;
|
|---|