in reply to How can I capture HTML code from my POP3 email body

I don't think Mail::POP3Client does any such translation. It dumps to the file exactly what it receives from the server.

By the way, what's this crazyness?

open(STDOUT, ">my_txt_output.txt"); my $fh = new IO::Handle(); $fh->fdopen( fileno( STDOUT ), "w" ); $pop->HeadAndBodyToFile( $fh, $i ); close STDOUT;

You should use

open(my $fh, '>', 'my_txt_output.txt') or die("Can't create my_txt_output.txt: $!\n"); $pop->HeadAndBodyToFile( $fh, $i );

Replies are listed 'Best First'.
Re^2: How can I capture HTML code from my POP3 email body
by background (Novice) on Oct 14, 2008 at 22:37 UTC
    good stuff -- many thanks for the clean up. i'm new to perl and unfortunately have buckets of crazyness in my code...

    but back to my original problem. i did some searching and found modules for sending HTML mail (such as HTML::Mail), but didn't find anything for retrieving HTML mail. i'm not sure but i believe the gmail servers do preserve the 'google alerts' messages in HTML. any thoughts out there about how to retrieve the HTML mail using perl? thanks again.