Hello -
The "smartsend" perl function below sends out emails, however, due to
a SENDMAIL peculaliarity, long lines show up with unwanted exclamation
marks. I read somewhere that adding
Encoding = 'quoted-printable'
may fix this but I don't know how to add it to the function.
I'm looking for the function below to be altered so that it does not
insert unwanted exclamation marks anymore when sending out emails
containing long lines.
Please post the complete, altered function as the answer to this question.
Thank you.
Marc.
# perl function:
sub smartsend {
my ($recipient, $sender, $subject, $textonly, $richhtml)=@_;
my $sendmail = "/usr/lib/sendmail -t";
my $email = <<THE_EMAIL;
From: $sender
To: $recipient
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="_jkkdsffds32432dlkjifewks_";
Subject: $subject
--_jkkdsffds32432dlkjifewks_
Content-Type: text/plain; charset="iso-8859-1"
$textonly
--_jkkdsffds32432dlkjifewks_
Content-Type: text/html; charset="iso-8859-1"
$richhtml
--_jkkdsffds32432dlkjifewks_--
THE_EMAIL
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $email;
close(SENDMAIL);
} |