Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Sending email with attachments using Email::Mime

by cord-bin (Friar)
on May 15, 2014 at 06:56 UTC ( #1086108=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Sending email with attachments using Email::Mime
in thread Sending email with attachments using Email::Mime

Ok, we are almost there, you need again a module and a very light change. I tried not to change your code too much just to get it work on my machine.
You need to change, actually add one line to this part:

use IO::All; # install this module first push @parts, Email::MIME->create( attributes => { filename => $attachments{doc_name}, content_type => $attachments{doc_mime_type}, disposition => 'attachment', encoding => 'base64', name => $attachments{doc_name} }, body => io($attachments{doc_name})->all, # add this line );
For the illegal seek error, just delete these lines, you don't need them:
#print "error1 $!\n"; #print "error2 $Mail::Sendmail::error\n";
Cheers, have fun!


Comment on Re^3: Sending email with attachments using Email::Mime
Select or Download Code
Re^4: Sending email with attachments using Email::Mime
by gezb (Novice) on May 15, 2014 at 09:47 UTC

    Thats great, all working now. Thanks for your help and advice. This is why I love Perl !!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1086108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2015-07-06 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls