cc and bcc and to command in shellscript


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cc and bcc and to command in shellscript
# 1  
Old 04-12-2012
cc and bcc and to command in shellscript

Hi All,

I have tried some below commands , some of these are working. some are not working.

I want to add this "TO ,cc, bcc, from " in shellscript.

can anyone give me the example for this.

Code:
 
mailx -s "$SUBJECT5" "$EMAIL" < $EMAILMESSAGE

above code is working but i want to add to cc and bcc in it. tried below but not executting the proper.

Code:
 
mailx -r 'Mymail@ID' -s 'hello ' abcd@ID < message_text_file

Please help me.


Thanks

Last edited by methyl; 04-12-2012 at 08:15 AM.. Reason: fix code tag
# 2  
Old 04-12-2012
There is much variation in the mailx command.
Please post what Operating System and version you are running and what mail transport your system uses (e.g. sendmail).
# 3  
Old 04-12-2012
Code:
 
Linux rkfvm20.name.com 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

# 4  
Old 04-12-2012
You need to use sendmail if you want to include Cc and Bcc in your mail distribution list...
# 5  
Old 04-12-2012
I don't have GNU/Linux but I have done this with mailx on unix. There is an alternative way of driving mailx from the mailx command prompt (similar to the ancient way of working the original unix mail command) before the likes of Netscape which gave you a GUI to the underlying mail commands.

If you can type a mailx tilde command at the mailx command prompt you can automate the process or even write a GUI mail program.

Can you post a link to the man page for your version of mailx?

Last edited by methyl; 04-12-2012 at 05:02 PM.. Reason: layot, typos
# 6  
Old 04-13-2012
Quote:
Originally Posted by shamrock
You need to use sendmail if you want to include Cc and Bcc in your mail distribution list...

can u plz give me any example?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shellscript command to remove files starting with a certain string, and older than 3 days

Hi All, Need help in identifying a shellscript command to remove all files on a server directory, starting with a certain prefix and also older than 3 days. That means files created with that prefix, today or yesterday, shouldn't be removed. Thanks, Dev (3 Replies)
Discussion started by: dev.devil.1983
3 Replies

2. Shell Programming and Scripting

How to use mailx command in shellscript?

Hi, i have run the below script in bash ...after running this command iam not getting any error but i am not getting the mail.Can anybody help me regarding this issue? #! /bin/bash x=50 if then mail -s "$x is greater than 25" manish.gupta@gmail.com fi (2 Replies)
Discussion started by: pspriyanka
2 Replies

3. Shell Programming and Scripting

Email with cc and bcc option

Hi, I am able to send email from AIX using the following command. cat email.txt | mail -s "Mail Subject" venkat@gmail.com Our requirement is send email with cc and bcc option. We are getting email with from email address as our UNIX server user. We would like to change that, please let us know... (2 Replies)
Discussion started by: vfrg
2 Replies

4. Shell Programming and Scripting

remove newline between two string with sed command in unix shellscript

I have a file (test.dat) which contains data like this 459|199811047|a |b |shan kar|ooty| 460|199811047|a |bv |gur u|cbe| but I need it like: 459|199811047|a |b |shankar|ooty| 460|199811047|a |b |guru|cbe| While reading the data from this file, I don't want to remove newline from the end of... (4 Replies)
Discussion started by: jcrshankar
4 Replies

5. Shell Programming and Scripting

Bcc in mailx command in Unix

Hi, At present we have been using the mailx command which is working perfectly and the command is as follows; mailx -s "$DESCR1" -c $DLIST_CC -r $REPLY $DLIST We would like to add a Blind carbon copy "Bcc" in this mailing list using mailx. Please let us know how this can be done in ksh. (2 Replies)
Discussion started by: jmathew99
2 Replies

6. UNIX for Advanced & Expert Users

Help needed on unix mail with bcc,

Hello Everyone, I'm using UNIX 5.3, I'm using command line mailx or mail command to send emails to multiple email addresses and i need to include bcc (background corbon copy). Some Manuals says i can use -b flag to send to bcc but my unix does not recognize the flag "-b". And some manuals says... (2 Replies)
Discussion started by: aravindbachu
2 Replies

7. UNIX for Advanced & Expert Users

mail command with bcc, cc

Can anyone tell me how to add bcc or cc email address to mail command? (1 Reply)
Discussion started by: aravindbachu
1 Replies

8. Shell Programming and Scripting

Unix mail with bcc option

Hello Everyone, I'm using UNIX 5.3, I'm using command line mailx or mail command to send emails to multiple email addresses and i need to include bcc (background corbon copy). Some Manuals says i can use -b flag to send to bcc but my unix does not recognize the flag "-b". And some manuals says... (1 Reply)
Discussion started by: aravindbachu
1 Replies

9. UNIX for Dummies Questions & Answers

bcc in mails

Hi, how to put some receipients for mail in bcc and some receipients in to. (2 Replies)
Discussion started by: prasee
2 Replies

10. UNIX for Dummies Questions & Answers

PS command doesnot display shellscript runningi

PS command doesnot display shellscript runningi have written a small shel script to check for idsk space and log it to a file evry 300s.this so this run is a loop. But i want to start stop this script from another script using ps -ef grep but ps -ef is not displaying the script in output, if i... (1 Reply)
Discussion started by: mpauls
1 Replies
Login or Register to Ask a Question