>         if ($suf eq 'gif') {
>                 $msg->attach(Type => 'image/gif',
>                   Path => "$s_dir/$nick/append/$at", Filename => $at);
>         } elsif ($suf eq 'jpg') {
>                 $msg->attach(Type => 'image/jpeg',
>                   Path => "$s_dir/$nick/append/$at", Filename => $at);
>         } elsif ($suf eq 'html') {
>                 $msg->attach(Type => 'text/html',
>                   Path => "$s_dir/$nick/append/$at", Filename => $at);
>         } elsif ($suf eq 'htm') {
>                 $msg->attach(Type => 'text/html',
>                   Path => "$s_dir/$nick/append/$at", Filename => $at);
>         } elsif ($suf eq 'txt') {
>                 $msg->attach(Type => 'text/plain',
>                   Path => "$s_dir/$nick/append/$at", Filename => $at);
>         } else {
>                 $msg->attach(Type => 'APLICATION',
>                   Path => "$s_dir/$nick/append/$at", Filename => $at);
>         }

I would put %h in a module and include a lot more file types ( someone
posted a listing of about 30 different MIME types a while back ).

  my %h = ( jpg => 'text/html',
            txt => 'text/plain' );

  $msg->attach( Type => $h{$suf}, 
                Path => "$s_dir/$nick/append/$at", 
                Filename => $at );

- Ron
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to