Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Mail with attachments, but w/o writing out a file first

by Rhandom (Curate)
on Sep 20, 2001 at 01:14 UTC ( #113473=note: print w/replies, xml ) Need Help??

in reply to Mail with attachments, but w/o writing out a file first

This reply has more to do with parsing messages with attachments rather than sending them, but...

I was recently writing some software that parses messages and separates attachments using the MIME::Entity suite of modules. I specifically had to specify not to save them out to temporary files as in the following code (note the output_to_core):

use IO::File; use MIME::Parser (); my $fh = IO::File->new('somemailfile','r'); my $parser = MIME::Parser->new(); $parser->output_to_core(1); # do everything in memory my $mail_object = eval{ $parser->parse($fh) };

Sorry this is not necessarily to the point, but I have included it in case you end up doing more than just send the attachments -- which almost always comes soon after being able to send them (ie - save a copy and read it in for later use).

my @a=qw(random brilliant braindead); print $a[rand(@a)];

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2021-05-11 08:08 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (114 votes). Check out past polls.