Do you mean save the attachment to the server as a .html? I've tried that and as a .txt.
Or do you mean just changing the script. Here's a cut down version of the script that I'm using for debugging
#!/usr/local/bin/perl
##############################################################
# SUCCESS.PL
$mailprog = '/usr/lib/sendmail';
$VSOemail = "orders\@mydomain.com";
$printerEmail = "orders\@mydomain.com
&sendVSOemail;
&writePage;
##############################################################
# Send Email to VSO
sub sendVSOemail {
$recipient = $VSOemail;
$mySubject = "Online Order Notification";
open (MAIL, "|$mailprog $recipient"

|| die "Can't open $mailprog!\n";
print MAIL <<EndOfFail ;
From: orders\@theclient.com
To: $recipient
Subject: $mySubject
MIME-Version: 1.0
Content-Type: multipart/related; boundary="NextPart_000_000D_01C002C4.95399B80"
X-Priority: 3 (Normal)
This is a multi-part message in MIME format.
--NextPart_000_000D_01C002C4.95399B80
Content-Type: text/plain; charset="iso-8859-1"
Plain text
--NextPart_000_000D_01C002C4.95399B80
Content-Type: text/html; charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#FFFFFF">
<hr size="1" width="420" align="left" noshade>
<b><font size="3" face="Arial, Helvetica, sans-serif">myTitle</font></b>
<hr size="1" width="420" align="left" noshade>
<p>This is the HTML part</p>
EndOfFail
print MAIL "</body></html>\n";
$file = 'cards/11111181.txt';
# does the next bit since the full script has just created this file and it needs permission
chomp($file);
chmod(0777, $file);
print MAIL<<EndOfAtt ;
--NextPart_000_000D_01C002C4.95399B80
Content-Type: text/plain; name="$file"
Content-Disposition: attachment; filename="$file"
EndOfAtt
open(FILE, $file) or die;
while( <FILE>) { print MAIL; };
close(FILE);
print MAIL "--NextPart_000_000D_01C002C4.95399B80--";
close (MAIL);
}
##########################################################################################
#
# Output HTML
#
sub writePage
{
print <<EndOfFail ;
Content-type: text/html
<html>
<head>
<title>Finished Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>finished</p>
</body>
</html>
EndOfFail
exit;
}
#####################################
Thanks to all of you that have invested your mental energy in this one.