ironcamel / Dancer-Plugin-Email

Simple email sending for Dancer
http://p3rl.org/Dancer::Plugin::Email
6 stars 10 forks source link

File attachments not working #2

Closed rrb3942 closed 13 years ago

rrb3942 commented 13 years ago

File attachments are not working, it instead sends an attachment where its contents is the file path given.

Looks like you are calling attach() instead of attach_file() from Email::Stuff.

From the Email::Stuff docs:

attach $contents [, $header => $value, ... ]

Adds an attachment to the email. The first argument is the file contents followed by (as for text_body and html_body) the list of headers to use. Email::Stuff should TRY to guess the headers right, but you may wish to provide them anyway to be sure. Encoding is Base64 by default. attach_file $file [, $header => $value, ... ]

Attachs a file that already exists on the filesystem to the email. attach_file will auto-detect the MIME type, and use the file's current name when attaching.

I changed this on my local copy and attachments work now.