sub Respond_HTML {
use MIME::Entity;
# first, format the email address for MIME::ENTITY
# create the top-level, and set up the mail headers:
my $top = build MIME::Entity
Type => 'multipart/mixed',
From => $our_email,
To => $email,
Subject => "Information from $us";
# next, add the body of the message:
attach $top
Data=> "Hello $name,\n\nHere is the information you requested.\n\n$us \n\n";
# now add the pretty leterhead:
attach $top
Path => "$path_to_home_dir/Images/letterhead.gif",
Type => 'image/gif',
Encoding => 'base64';
# now, make attachment/s:
for ($i=0 ; $i<=4; $i++ ) {
if ($request[$i]) {
attach $top
Path => "$path_to_home_dir/Auto_Respond_Files/$HTML_file[$i]",
Type => 'text/HTML',
Encoding => '7bit';
}
}
# finally, send it:
open MAIL, "|$mail_prog -t -i" or die "open: $!";
$top->print(\*MAIL);
close MAIL;
return 1;
}
# end Respond_HTML
# Send automatic msword.doc email response according to request(s)
sub Respond_MSWord {
use MIME::Entity;
# first, format the email address for MIME::ENTITY
# create the top-level, and set up the mail headers:
my $top = build MIME::Entity
Type => 'multipart/mixed',
From => $our_email,
To => $email,
Subject => "Information from $us";
# next, add the body of the message:
attach $top
Data=> "Hello $name,\n\nHere is the information you requested.\n\n$us\n\n";
# now, make attachment/s:
for ($i=0 ; $i<=4; $i++ ) {
if ($request[$i]) {
attach $top
Path => "$path_to_home_dir/Auto_Respond_Files/$msword_file[$i]",
Type => 'application/octet-stream',
Encoding => 'base64';
}
}
# finally, send it:
open MAIL, "|$mail_prog -t -i" or die "open: $!";
$top->print(\*MAIL);
close MAIL;
return 1;
}