in reply to Sending email with Perl

This ought to be a FAQ if it ain't already.

MIME::Lite is your friend.

For more information on what is going on there check out MIME::Lite's man page.

Caveats

First off I broke all of my rules with this example in that I do no error checking anywhere. Secondly, if your CGI parameters have multiple values then my code above will break. I leave the solution to that as an intellectual excersize for you to solve.

Another potential problem with the code above is the use of CGI::Carp qw / fatalsToBrowser/. This is a potential information leak for hackers if you use that in production and they manage to make your code break.

I dashed this off as I am about to be late for a meeting, but there is the nucleus of a solution for you.


Peter L. BergholdBrewer of Belgian Ales
Peter@Berghold.Netwww.berghold.net
Unix Professional