I am trying to create an e-mail with an attachment during a cron job. My only option is sendmail, so that makes it more difficult. Below is the code I am using, the error I am getting is:
Error Text:
syntax error at line 251 : `<<' unmatched
Line 251 is the cat command, I am not sure what I am doing wrong.
Code:
cat << EOF > ./mailfile2
# Create Header of Log File for e-mail failure
echo "To: $to" >> $mailfile2;
echo "Reply-To: $to" >> $mailfile2;
echo "Subject: $subject" >> $mailfile2;
echo $sMime >> $mailfile2;
echo $sContent_Type_Text >> $mailfile2;
echo sBody >> $mialfile2;
echo $sBoundary >> $mailfile2;
echo $sContent_Type_File >> $mailfile2;
echo $sContent_Disp >> $mailfile2;
echo $Content_Encoding >> $mailfile2;
echo "New data" >> $mailfile2;
echo $sBoundary >> $mailfile2;
echo "Sending e-mail";
EOF
#send the mail
/usr/sbin/sendmail -f$from -t < $mailfile2 >/dev/null
Thanks in advance for any assistance,
Ati2ude
Error Text:
syntax error at line 251 : `<<' unmatched
Line 251 is the cat command, I am not sure what I am doing wrong.
Code:
cat << EOF > ./mailfile2
# Create Header of Log File for e-mail failure
echo "To: $to" >> $mailfile2;
echo "Reply-To: $to" >> $mailfile2;
echo "Subject: $subject" >> $mailfile2;
echo $sMime >> $mailfile2;
echo $sContent_Type_Text >> $mailfile2;
echo sBody >> $mialfile2;
echo $sBoundary >> $mailfile2;
echo $sContent_Type_File >> $mailfile2;
echo $sContent_Disp >> $mailfile2;
echo $Content_Encoding >> $mailfile2;
echo "New data" >> $mailfile2;
echo $sBoundary >> $mailfile2;
echo "Sending e-mail";
EOF
#send the mail
/usr/sbin/sendmail -f$from -t < $mailfile2 >/dev/null
Thanks in advance for any assistance,
Ati2ude