in reply to Email Header

Here's some code that I use to do what you're looking for:
if ( $line =~ /^From: (.+?)$/i ) { $newFrom = $1; $newFrom = $1 if $newFrom =~ /<(\S+)>/; }

Replies are listed 'Best First'.
Re: Re: Email Header
by Anonymous Monk on Nov 13, 2001 at 22:07 UTC
    Thanks that last one got the from email address which is great, but now I have two other small problems :) getting the subject and the actual message - here is my code (the @message tags picks up all the MIME- lines)
    while (<STDIN>) { last if /^$/; if ( $_ =~ /^From: (.+?)$/i ) { $newFrom = $1; $newFrom = $1 if $newFrom =~ /<(\S+)>/; } $subject = "$1" if /^Subject:(.+)$/; } while (<STDIN>) { push @message, $_; }