HPUX mailx CC list


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HPUX mailx CC list
# 1  
Old 07-15-2010
HPUX mailx CC list

I want to use CC(Carbon Copy) in mail list using HP-UX

I am using the command :
Code:
echo "hello" |mailx -m -s"subject" -c "CC_LIST" "TO_LIST"

but I am getting an error -c illegal option...I tried with the solution from forums but no luck...

Last edited by Scott; 07-16-2010 at 06:59 AM.. Reason: Code tags
# 2  
Old 07-16-2010
Try...
Code:
( echo '~c ' "CC_LIST"
  echo "hello" )|mailx -m -s"subject"  "TO_LIST"

# 3  
Old 07-16-2010
Thanks Ygor,
It is working fine however I am using :

Code:
uuencode file_1 file_2 >attachment.txt
cat mail_body attachment.txt cc_list > combined.txt
mailx -m -s "subject" -r abc@cd.com my_mail_id@abc.com < combined.txt

in cc_list i put
Code:
 '~c ' cd_addr@abc.com

however no luck

Last edited by Scott; 07-16-2010 at 06:59 AM.. Reason: Please use code tags
# 4  
Old 07-16-2010
From "man mailx". Your second version may misunderstand what the "-r" switch is for.

Quote:
-r address Pass address to network delivery software. All
tilde commands are disabled.

Back to the first script.

I have yet to get mailx to send to multiple recipients without sending multiple emails. The default sendmail configuration cleverly adjusts the CC list to avoid mentioning the same email address twice.

Assuming sendmail is the default configuration.

File cc_list should contain no quote characters and a list of CC recipients one per line.
The mail address must be exactly the same in the CC list as the address we send to in mailx (case significant).
Code:
~c tom@abc.com
~c dick@abc.com
~c harry@abc.com

Code:
# The script sends one mail per recipient mentioning the CC recipients.
for recipient in tom@abc.com dick@abc.com harry@abc.com
do
    (cat cc_list; cat mail_body; ux2dos file_1 | uuencode attachment.txt)|mailx -m -s "subject" ${recipient}
done

# 5  
Old 07-17-2010
Thanks Methyl,

Now I am ablt to send mail with body,attachment cc and recepient mail address.
However if I am using -r option then cc is not working ....as u told that -r will disable ~
is there any way out...I want to send mail having :
mail body
attachhment
cc list
to list
sender mail id

---------- Post updated 07-17-10 at 08:48 AM ---------- Previous update was 07-16-10 at 03:10 PM ----------

Is there any way out...I want to send mail (HP UX mails)having the fdollowing options:
-s Subject
-r sender
~c cc list
uuencode
body
# 6  
Old 07-18-2010
There is no rational reason to use the "-r" option in this context. It is not a parameter for the email addresses of a list of recipients. Hope this is is clear.
# 7  
Old 07-19-2010
yes I got it....
Is there any other alternative in HPUX...
I want to send mail with:

1) to list
2) cc list
3) sender address
4) mail body
5) subject
6) attachment
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

How to list file size on HPUX?

I used to use ls -l cut to detrmine file size, and google searches didn't come up with anything else but 'stat' which doesn't appear on HPUX. I discovered the humble 'wc -c' which does this job very neatly, and thought I would share it. (7 Replies)
Discussion started by: tbochan
7 Replies

2. HP-UX

pwage-hpux-T for Trusted HPUX servers

I'm sharing this in case anybody needs it. Modified from the original solaris pwage script. This modified hpux script will check /etc/password file on hpux trusted systems search /tcb and grep the required u_succhg field. Calculate days to expiry and notify users via email. original solaris... (2 Replies)
Discussion started by: sparcguy
2 Replies

3. Shell Programming and Scripting

unable to put cc list in mailx

Hi, I am using mailx command to send mail. But unable to use -c option to send mails by cc list. eg. ..mailx -s "subject" -c "CCLIST" "TOLIST" Its showing " illegal option -- c" I am using HP UX. Can anybody help me out. Thanks in advance..! (3 Replies)
Discussion started by: Kattoor
3 Replies

4. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies

5. UNIX Desktop Questions & Answers

Using Mailx to send to list of email addresses

Im trying to use a shell script to send to a list of email addresses in a txt file. Here is what i have tried but it keeps sending to dead.letter... Success.ksh contains... mailx -s"Night Batch Success" 'cat /Scripts/email_addresses.txt' < /Scripts/email_body_message.txt The email body... (1 Reply)
Discussion started by: aguad3
1 Replies

6. Solaris

distribution list won't expand in mailx message

Hi, I have a distribution list called /nisserver/sysadmin/user-alias-files/all_users. The contents of the file have the userid/usernames of the techs in my company. These userid/usernames in the file do not have the @abc.com appended to them. After I type the newaliases command the results... (4 Replies)
Discussion started by: antalexi
4 Replies

7. UNIX for Dummies Questions & Answers

mailx error message : mailx: NUL changed to @

If I use the "Mail" link instead of the "mail" link to ../mailx I get this error. Mail so-n-so @whatever.com mailx: NUL changed to @ Unknown command: "postmaster" The email still goes through but i get the error. If I use "mail" it goes thru without the error. Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

8. HP-UX

HPUX list files with access time more than 5 min

Hi, does anyone know how to find files who have the last access time bigger than 5 min ago, in linux i use: find ./ -amin +5 -type f -maxdepth 1 -name "*.*" but in hp-ux the find command doesn't have the -amin option.... (2 Replies)
Discussion started by: mvrk
2 Replies

9. HP-UX

creating a mailng list for mailx

I'm trying recall how to set up a script to have mailx read a mailing list of people to recieve a message. I had set up the script to have every name inside but the list could grow and/or change. can any one help? I'm using HPUX 11 on a rp7410. (6 Replies)
Discussion started by: rfmurphy_6
6 Replies

10. UNIX for Dummies Questions & Answers

mailx and mail list help - newbie qustion

I have a basic question - how do I create and then use a mail list to be able to send a mailx email to multiple recipients. I assume I create a test file using vi, containing the email addresses - but what is the format - are the addresses separated by ";", or by spaces, ....??? Is there a... (1 Reply)
Discussion started by: HikerLT
1 Replies
Login or Register to Ask a Question