Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm having trouble retrieving the the body of e-mail that is sent as STDIN into a little Perl program I have. I can easily get the To: , From: and the Subject, but not the body. What am I missing. Code is below
#!/usr/bin/perl <>; use Mail::Internet; use DBI; $msg = Mail::Internet->new([ <> ]); $from = $msg->get('From'); $msg->combine('To'); $to = $msg->get('To'); $subject = $msg->get('Subject'); $body = $msg->('Body'); #doesn't work
thanks

Replies are listed 'Best First'.
Re: Mail::Internet, body retrieval
by dws (Chancellor) on Apr 04, 2001 at 05:38 UTC
    Change   $body = $msg->{'Body'}; to   $body = $msg->body(); See Mail::Audit for a working example of how to use Mail::Internet.