Email Question - two email addresses

Hello,
I have an email script that runs when a process is complete. I would like to have the email sent to two different email addresses, but it is only sending it to the first one. Can you take a look and see what I need to correct? I thought if I surrounded them with double quotes and separated them with a comma that would work. I don't have sendmail configured so I use telnet. This is an AIX 5.2 system Thank you.

#!/usr/bin/ksh
MAILADDRTO="first@someplace.com,second@someplace.com"
MAILADDRFR=email@mail.com
(sleep 5
echo EHLO
sleep 5
echo MAIL FROM: $MAILADDRFR
sleep 5
echo RCPT TO: $MAILADDRTO
sleep 5
echo DATA
sleep 5
echo From: $MAILADDRFR
echo To: $MAILADDRTO
echo subject: PBS Check File Created
echo
echo The PBS check file is available for download
echo
sleep 5
echo .
sleep 5
echo QUIT
sleep 5) | telnet 00.00.00.00 25

According to google you need to use multiple RCPT lines:

...
for rcpt in `echo $MAILADDRTO | sed 's/,/ /g'`
do
  echo RCPT TO: $rcpt
  sleep 5
done
...

Scripting a raw telnet to port 25 is monstrously misdirected, though. See if you can install a minimal SMTP client such as Perl with Net::SMTP instead.

Thank you Smiling Dragon for the response. Era, yes you are right. Just laziness on my part.

You can use like this

MAILADDRTO="first@someplace.com\,second@someplace.com\"

it could be works...

Regards,
MPS

It would work like that if you were using regular Sendmail, but this script attempts to speak raw SMTP, which at least per the spec does require a separate RCPT TO: for each recipient address.