![]() |
|
|
|
|
|||||||
| 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 |
| How to send a mail using elm in cc list? | svenkatareddy | SUN Solaris | 0 | 03-03-2008 06:19 AM |
| How to send a mail using elm in cc list? | svenkatareddy | Shell Programming and Scripting | 0 | 03-03-2008 04:41 AM |
| Regarding mailing to a distribution list (DL) using mail/mailx command | naren_0101bits | Shell Programming and Scripting | 1 | 02-06-2008 09:25 AM |
| want to mail a list of files in different servers | AshishK | UNIX for Advanced & Expert Users | 1 | 10-07-2007 12:23 PM |
| mailx and mail list help - newbie qustion | HikerLT | UNIX for Dummies Questions & Answers | 1 | 02-09-2004 09:27 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi
I am having a shell script that will send the report as an attachment to the number of receipients. There are chances that these receipients keep on chaging frequently. So I was thinking of some way by which I need not hard code the receipients in the shell script. Instead if i can put them into a file and read the file to get names of receipients . but not able to achive this in shell script. It will of great help for me if somebody can help me with code. ( I am pretty new to shell scripts) Many thanks |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
You can try creating (or adding to, if you have one) a .mailrc file in which you may define mail groups.
|
|
#3
|
|||
|
|||
|
try this,
for the frequently changing address entries you can have it in a file and for any future changes you can just change the file entry :<mail.address.entries> you neednt revisit the script to send a particular file as body of the mail Code:
mailx -s "<your subject>" "`cat <mail.address.entries>`" < <file_to_be_sent> Code:
uuencode <source_file> <decoded_path_name> | mailx -s "<your subject>" "`cat <mail.address.entries>`" |
|
#4
|
|||
|
|||
|
Mailing List
thanks for the solution.
have another doubt how do i list the receipients names in the address file? whether they should be comma separated or semi colon or something else ? |
|
#5
|
|||
|
|||
|
a simple file listing like this with each address entries in a line
would do >cat mail.address abc@xyz.com eft@erg.com afhs@ert.com > |
|
#6
|
|||
|
|||
|
hi
here is my address file > cat mail.address abc@gmail.com xyz@mailserver.com === script code == > cat mail.sh #!/bin/ksh SPOOLFILE=pk_comp_tools.sh echo "Send the E-mail message..." mail -s "$SUBJECT" "`cat mail.address`" <<EOF Please find the report attached. `cat $SPOOLFILE | uuencode $SPOOLFILE` EOF == == this is sending mail to only first address and second address is being displayed as part of mail body. I tried giving the address in "mail.address" by separating them using comma. but still the mail is going to first person only. |
|
#7
|
|||
|
|||
|
i have modified ur script ...
and use mailx please try this and let me know Code:
#!/bin/ksh SPOOLFILE=pk_comp_tools.sh echo "Send the E-mail message..." (echo "Please find the report attached." ; uuencode $SPOOLFILE $SPOOLFILE.txt ) | mailx -s "$SUBJECT" "`cat mail.address`" |
|||
| Google The UNIX and Linux Forums |
| Tags |
| linux, mailx, mailx attachment |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|