my $filename = "E:/test.pdf"; my $type = "application/pdf"; $msg->attach( Type => $type, Disposition => 'attachment', Path => $filename, Filename => $filename, Binmode => 1, ) or die "Error adding PDF: $!\n";