Ahhhh let me see if it will work now... | [reply] [Watch: Dir/Any] |
Very nice catch!! Thank you soon much! | [reply] [Watch: Dir/Any] |
my $emailCC = 'Any Person <anyperson@anywhere.com,nobody@nobody.com,so
+mebodyelse@icloud.com>';
print MAIL "To: $emailTo\n";
print MAIL "Cc: $emailCC\n";
.
.
poj | [reply] [Watch: Dir/Any] [d/l] |
For situations where you have a stream of lines, a here-doc can significantly improve readability. As well, a two-argument open without a check is considered bad practice. Combining all this with a lexical filehandle and poj's suggestion, I might write your script as:
my $emailTo = 'Customer Service <customerservice@df-foods.com>';
my $emailCC = 'Frank Simmons <fsimmons@oregonpotato.com,susan@ftiegs.c
+om,jenbrink@icloud.com>';
my $emailFrom = FilterCChars($FTGEmail);
open(my $mail,'|-', $mailProg) or die "Problem accessing $mailProg: $!
+";
print $mail <<EOT;
To: $emailTo
Cc: $emailCC
From: $emailFrom
Subject: $emailSubject
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
$emailBody
EOT
close $mail;
# Redirect user to success page
print "Location: /thankyou.html\n\n";
exit;
Note how much cleaner that looks without all the newlines and print commands.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
| [reply] [Watch: Dir/Any] [d/l] |
A) Welcome to the monastery, jenlear!
B) As poj is pointing out, curly quotes (sometimes called "smart quotes") are not the same as straight quotes in Perl. You'll have a lot easier time if you find a programming-oriented text editor program that doesn't change your straight quotes to curly ones. If we knew what OS you were using, maybe we could suggest a good one. | [reply] [Watch: Dir/Any] |