my $mail = MIME::Lite->new(Subject => 'some_subject', Type => 'multipart/mixed'); # non MIME::Lite code here... my $msgBody = "some foo message"; $mail->attach(Type => 'TEXT', Data => $msgBody); #more non MIME::Lite code here... for my $attachment (@attachments) { my ($filePath, $fileName) = split (/:/, $attachment); $mail->attach(Type => 'application/octet-stream', Path => $filePath, Filename => $fileName, Disposition => 'attachment'); }