#! /usr/bin/perl -wT # use strict; #force all variables to be declared before use use CGI qw(:standard escapeHTML); # import most common gateway inte +rface functions use CGI::Carp qw(warningsToBrowser fatalsToBrowser); #cause all diagno +stics to be sent to browser use Mail::Sendmail; use MIME::Entity; print header; print start_html (-title => "email"); my $from = qq~"Me" <me\@here.com>~; my $to = qq~"You" <you\@there.com>~; my $cc = qq~"Him" <him\@overthere.com>~; my $bcc = qq~bccguy\@where.com>~; $ENV{PATH} = "/usr/sbin"; open (MAIL, "|/usr/sbin/sendmail -t") or &dienice("Can't fork for send +mail: $!\n"); print "Testing Mail::Sendmail version $Mail::Sendmail::VERSION &nb +sp  \n\n"; print "\n\nDefault server: $Mail::Sendmail::mailcf +g{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 => [ "<p><font size='3' face='Times' color='black'>HTML test:</font>\n\n", "<p><a href='http://www.anyoldsomethingforurl.com'> any old URL</a>\n\ +n", "<p><img src='http://www...../images/image1.jpg' height='361' width='2 +50' alt='any old image'>\n\n" ]); $top->attach (Path =>"/home/..../public_html/images/p +ower.pps", Type => "application/vnd.ms-powerpoint" +, Encoding => "base64", ); $top->attach (Path =>"/home/..../public_html/images/i +mage2.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);
In reply to scoping problem with Mail::Sendmail by gmacfadden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |