Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by cord-bin (Pilgrim)
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 surveying the Monastery: (5)
As of 2014-12-20 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls