
Cure
User
Jul 8, 2000, 9:10 AM
Post #2 of 2
(314 views)
|
|
Re: problems sending attachments
[In reply to]
|
Can't Post
|
|
#!/usr/bin/perl -w use CGI qw(:standard); use MIME::Lite; if ( param('submit')) { my $fh; if( $fh = upload('uploaded_file')) { binmode $fh; my $content = do { local $/; <$fh>; }; my $msg = new MIME::Lite( From => 'root@localhost', To => 'you@texas.net', Subject =>'A Test Message ...', Type =>'multipart/mixed'); $msg->attach(Type => 'TEXT', Data => 'The test attachment'); $msg->attach(Type => 'application/x-unknown', Data => $content, Filename => $fh); $msg->send; print header,start_html,h1("Sent ..."),end_html; } else { print header,start_html,h1("Oops ..."),$fh,end_html; } } else { print header, start_html, start_multipart_form, filefield(-name=>'uploaded_file'), submit(-name => 'submit'), end_html; } Cure [This message has been edited by Cure (edited 07-08-2000).]
|