The documentation you read contains at least one example on sending a mail with an attachment.
You will see that your script is not a multipart message, as it doesn't have a body part, but only an attachment part ... that is being considered as the body.
Add the missing part, and it works.
HTH -- Olivier
Comment on Re: Attachment displays in email's body using Mail::Sender