![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Not able to send email as CC to a ID using Mailx command in HP UX | rohit.shetty84 | UNIX for Dummies Questions & Answers | 1 | 05-14-2008 12:27 AM |
| Using Mailx to send to list of email addresses | aguad3 | UNIX Desktop for Dummies Questions & Answers | 1 | 03-28-2008 12:40 PM |
| to send email to multiple users | vishwas.shenoy | UNIX for Dummies Questions & Answers | 0 | 01-25-2008 03:00 AM |
| How to send attachment to web-based email client using mailx | randomcz1 | Shell Programming and Scripting | 1 | 11-07-2006 02:00 PM |
| Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win) | Vetrivela | UNIX for Advanced & Expert Users | 2 | 02-15-2005 07:43 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Using mailx to send email to multiple users.
Hi,
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. xyz.ini MAILLIST='priyaksingh@rediffmail.com,reahksingh@yahoo.co.in' script EMAIL=`grep "MAILLISt=" /xyz.ini | cut -f2 -d=`; export EMAIL .... .... .... mailx -s "Hi" ${EMAIL} <<! Hi ! Please do let me know about the exact command that will send email to multiple users. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
#3
|
|||
|
|||
|
Thank You Vino. the solution works fine untill the same email ids are assigned to a variable and this list is coming from a property file.
My Property File. List="receip@xyz.com, receip2@xyz.com" My Script MailList=`grep "List=" /propertyfile.ini | cut -f1 -d"+"` export MailList mailx -s "Hi" $MailList < text.msg The above code fails. help me out its urgent. |
|
#4
|
||||
|
||||
|
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=". |
|
#5
|
|||
|
|||
|
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. Regards, Manish Jha |
|||
| Google The UNIX and Linux Forums |