Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by gezb (Novice)
on May 14, 2014 at 21:28 UTC ( [id://1086085]=note: print w/replies, xml ) Need Help??


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

Thanks for your reply. I installed Email::Sender::Simple and changed the code as you suggested. A lot closer now. I am receiving the attachments but they are 0 file size so they cant open or save the documents from the email. I am also receiving the error `error1 Illegal seek` . Should not make any difference but I am using Ubuntu. Any ideas.

  • Comment on Re^2: Sending email with attachments using Email::Mime

Replies are listed 'Best First'.
Re^3: Sending email with attachments using Email::Mime
by wjw (Priest) on May 14, 2014 at 22:01 UTC
    Was curious to see what I might find about this: Not a great deal, but thought this was interesting in case you were using postfix:

    Postfix Illegal seek. Probably way outside of what your experincing... but then sometimes long shots pay off.

    Best of luck...

    ...the majority is always wrong, and always the last to know about it...
    Insanity: Doing the same thing over and over again and expecting different results...
Re^3: Sending email with attachments using Email::Mime
by cord-bin (Friar) on May 15, 2014 at 06:56 UTC
    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!

      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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1086085]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-19 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found