I am using the mailx command to send email to multple users. The command works fine when i am sending mail to a single user but when i insert multiple email ids inside the quote it does not work. All the email ids are coming from a property file.Please have a lookt at the property file and the script below below.
The problem is how you define the $Maillist variable. Try running with set -x if using ksh.
Perhaps you could post your real code here. Your "properties" file is either called xyz.ini
or propertyfile.ini and either begins with "List=" or "MAILLIST=".
Hey Priya,
Simply I see only problem to this and that is "," in your mail list. Try to remove comma from mail list and separate the email ids by space and hope you should be all set.
Other wise you could just use sendmail command with "," separated email ids.
Syntax for the sendmail.
LOGNAME=`whoami` #If mail couldnot be send, it will bounce on this account
MailList=${Mail_File_Path}/Mail_List.txt
MAILTO=`cat $ MailList `
echo "From: $LOGNAME\nTo: $MAILTO\nSubject: $SUBJECT" > $mail_body_file
echo "
$SUBJECT.
Regards,
$LOGNAME" >> $mail_body_file
echo ".\n" >> $mail_body_file #Mail will not be sent to anyone if "." does not appear in first column of th
/usr/lib/sendmail -t -oi < $mail_body_file
Don't forget to add . at the last like I used here with echo. It is mandatory.
Here you can use To,CC,BC, subject attachement ect. Its almost identical to outlook mail so you can use all the facilities what ever you can see in your outlook on windows.