Thanks for your reply.
I'm on Windows, I don't know basename() function, so I changed to absolutely path, but I still got the same result, the pdf file is not correct.
in reply to Re^5: SMTP auth() command not supported on smtp.live.com
in thread SMTP auth() command not supported on smtp.live.com
my $filename = "E:/test.pdf";
my $type = "application/pdf";
Type => $type,
Disposition => 'attachment',
Path => $filename,
Filename => $filename,
Binmode => 1,
) or die "Error adding PDF: $!\n";