#! /usr/bin/perl -wT # use strict; #force all variables to be declared before use use CGI qw(:standard escapeHTML); # import most common gateway interface functions use CGI::Carp qw(warningsToBrowser fatalsToBrowser); #cause all diagnostics to be sent to browser use Mail::Sendmail; use MIME::Entity; print header; print start_html (-title => "email"); my $from = qq~"Me" ~; my $to = qq~"You" ~; my $cc = qq~"Him" ~; my $bcc = qq~bccguy\@where.com>~; $ENV{PATH} = "/usr/sbin"; open (MAIL, "|/usr/sbin/sendmail -t") or &dienice("Can't fork for sendmail: $!\n"); print "Testing Mail::Sendmail version $Mail::Sendmail::VERSION    \n\n"; print "\n\nDefault server: $Mail::Sendmail::mailcfg{smtp}->[0]    \n\n"; my $top = MIME::Entity->build(Type => "multipart/mixed", From => "$from", To => "$to", Cc => "$cc", Bcc => "$bcc", Subject => "two attachment email"); $top->attach (Type =>"text/html", Encoding => "quoted-printable", Data => [ "

HTML test:\n\n", "

any old URL\n\n", "

any old image\n\n" ]); $top->attach (Path =>"/home/..../public_html/images/power.pps", Type => "application/vnd.ms-powerpoint", Encoding => "base64", ); $top->attach (Path =>"/home/..../public_html/images/image2.jpg", Type => "image/jpg", Encoding => "base64", ); $top->print(\*MAIL); print "\n\n\$Mail::Sendmail::log says:   $Mail::Sendmail::log\n"; close(MAIL); print end_html; exit (0);