Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use Mail::Sender; $q = new CGI; # uploading the file... my $position = &filter($q->param('position')); my $name = &filter($q->param('name')); my $email = &filter($q->param('email')); my $filename = &filter($q->param('filename')); print header(); if ($filename ne ""){ $tmp_file = $q->tmpFileName($filename); }else{$filename= "No Attachment";} ref ($sender = new Mail::Sender({from =>$email,smtp=> 'mytest.temp.hos +ting.com'})) or die "$Mail::Sender::Error\n"; (ref ($sender->MailFile( {to =>'thetester@test.com', cc=>'mytest@test.com',subject =>$positio +n, msg => "Hi.\nI'm sending you the pictures you wanted.", file => $filename })) and print "Mail sent OK." ) or die "$Mail::Sender::Error\n"; sub filter { $_[0]=~s/\'/\\\'/g; $_[0]=~s/<//g; $_[0]=~s/>//g; $_[0]=~s/;//g; $_[0]=~s/\(//g; $_[0]=~s/\)//g; $_[0]=~s/\"//g; $_[0]=~s/\'//g; $_[0]=~s/\?//g; $_[0]=~s/script//g; $_[0]=~s/\///g; $_[0]=~s/>//g; $_[0]=~s/@/\@/g; #$_[0]=~s/\%2F//g; return $_[0]; } __END__
Edit by BazB: add readmore tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Email attachment help!
by Coruscate (Sexton) on Jan 27, 2004 at 21:22 UTC | |
|
Re: Email attachment help!
by bassplayer (Monsignor) on Jan 27, 2004 at 21:28 UTC | |
|
Re: Email attachment help!
by bobn (Chaplain) on Jan 28, 2004 at 00:38 UTC |