in reply to submit form data thru email

Check out merlyn's article on the subject; I found it very useful when working on a similar project.

While working on the project, I made some observations you may find helpful (note that the following code has been simplified from the final, so certain typos may have been made):

if ( $copiesto ) { $msg->add( CC => $copiesto ); }
$msg->attach ( Disposition => 'attachment', Type => $sentinfo->{ 'Content-Type' }, Encoding => 'base64', Filename => $sentname, FH => $sentfile );
if ( defined( $settings{ "DEBUG" } ) ) { $msg->attach ( Type => 'TEXT', Encoding => 'base64', Filename => 'debug.txt', Disposition => 'attachment', Data => [ "Upload info\n\n", "File size = $sentsize\n", ( map { "$_ = $sentinfo->{ $_ }\n" } sort keys %$se +ntinfo ), "\n", "ENV Contents:\n\n", ( map { "$_ = $ENV{ $_ }\n" } sort keys %ENV ), "\n", "Configuration Settings:\n\n", ( map { "$_ = $settings{ $_ }\n" } sort keys %setti +ngs ) ] ); }
my $cgi = new CGI; my $sentfile = $cgi->upload( 'sentfile' ); my $sentsize; my $sentinfo; my $sentname; if ( $sentfile ) { $sentsize = -s ( $sentfile ); # file size $sentinfo = $cgi->uploadInfo( $sentfile ) ; fileparse_set_fstype( "MSDOS" ); # risky assumption? my ( $sentname ) = fileparse( $sentfile ); }

It's not perfect by any means, but it worked well and was a reasonably easy job--once I had merlyn's starting point.

In short, merlyn's article is very helpful, but you'll want to read the MIME::Lite docs pretty carefully and to experiment with the article's code to see how it works on your system.

Also, there are several other threads in the archives that offer alternative approaches and other information.

--f