problem with mailx


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users problem with mailx
# 1  
Old 03-01-2006
problem with mailx

Hi unix lovers,

I have some problem with using mailx. I want to send mail as per the instructions in a file. The mail does not reach to CC recepients.

To get a clearer picture, this is what I am typing on unix prompt.

$
$ mailx ashishp@suntech.com < mail.txt
$

And my mail.txt looks as below

$ cat mail.txt
~s testing
~c 'vganta@suntech.com,ajaygo@suntech.com'
This is just testing
$

I am using solaris.
$ uname -a
SunOS snvi003 5.8 Generic_117350-20 sun4u sparc SUNW,Sun-Fire-V240
$

I have checked with the man pages but could not find any useful info.

Any pointers would help.

thanks in advance..

-Ashish
# 2  
Old 03-01-2006
to send mail to 'CC' receipients

mailx -c "<CC_address>" -s "<subject>" "<TO_Address>" < contents

this info is available in man mailx
# 3  
Old 03-01-2006
Matrixmadan,

thanks for the reply. But the option -c and -s work properly when I give the CC list in the command line itself.
This is not true in my case. I have written the subject, CC list and contents in a file. If I use -s and -c in the file I get the mail as below

"
-s testing
-c 'vganta@sunteh.com,ajaygo@suntech.com'
This is just testing
"

i.e. I receive the cc list and the subject in the mail itself. The mail does not reach to CC recepients. If i use ~s and ~c in the file, subject line work properly. If there is one mail id in CC list it work properly. But if i use more mail ids in CC list no CC recepient get the mail.

Please advice how to get it worked.

-Ashish
# 4  
Old 03-01-2006
i am sorry, still not clear with your problem

could you please give the file contents
and the command that you had tried,

that would help to easily analyze!
# 5  
Old 03-02-2006
Matrixmadhan,

I am not able to send mail to CC recepients when there are multiple mail ids in CC list.
This is what I entered on unix prompt.

$ mailx ashishp@suntech.com < mail.txt


And my mail.txt looks as below

$ cat mail.txt
~s testing
~c 'vganta@suntech.com,ajaygo@suntech.com'
This is just testing
$


Note that ~s and ~c are part of my file above. Above I have used cat command to see the file.

Hope my question is clear.

-Ashish
# 6  
Old 03-02-2006
having multiple receipients in CC,

use the following format,

Code:
mailx -c "`cat ccfile`" -s "sub" "RECEIPIENT_ID" < text

have the cc receipients list in cc file

>cat ccfile
abc@xyz.com
uvw@sdh.com
# 7  
Old 03-02-2006
Hi Matrixmadhan,

thanks. it works.
I have found other way too. If cc list is given in a file there is no need of quote for multiple mail ids. Now my mail.txt look like

$ cat mail.txt
~s testing
~c vganta@suntech.com ajaygo@suntech.com
This is just testing
$


The quote in 2nd line are removed. The mail ids are separated by space.

Thanks a lot.

-Ashish
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

mailx problem

I executed my script in linux environment so Here Im facing problem.In linux has mailx command but if i include in following way Im getting error like ./script2.sh: line 6: mailx: command not found. if I use mail command also Im getting same error. $ cat script2.sh while ps | ./pwtst do... (5 Replies)
Discussion started by: ksrivani
5 Replies

2. Solaris

Mailx hanging problem

Hi all, I issued the following mailx -s "TEST" <mail> However it just hang there. :wall: How do i diagnose why it behave like this? Thanks. ---------- Post updated at 02:20 PM ---------- Previous update was at 10:27 AM ---------- No reply on this. Any help will be appreciated. I'm... (2 Replies)
Discussion started by: beginningDBA
2 Replies

3. Shell Programming and Scripting

mailx problem with multiple cc

I am writing a script to send an email of the result of the process but i cannot make the cc work correctly. RECIP="abc@example.com def@example.com" CC="ghi@example.com jkl@eaxmple.com" mailx -s "testing" -c $CC $RECIP < inputfile.txt Result: To: abc@example.com; def@example.com;... (4 Replies)
Discussion started by: The One
4 Replies

4. UNIX for Dummies Questions & Answers

problem with mailx command

Hi, I have written down a script and in that im using mailx command in Unix. Such that i have taken the reciepent that would be in "To" using read command i.e from standard input and echoed the reciepients in cc into a file .Now im not able to use the mailx -r ie which sends the sender... (1 Reply)
Discussion started by: navjotmannan
1 Replies

5. UNIX for Dummies Questions & Answers

mailx -c PROBLEM

hi All, i want to email to abc@abc.com which will be in "to" and to def@def.com which will be in "cc". i tried like this: mailx -s "Total Collection" abc@abc.com -c def@def.com but i took error :( How can i success? Thanx so much. ---------- Post updated at 08:19 AM... (1 Reply)
Discussion started by: temhem
1 Replies

6. Shell Programming and Scripting

mailx, uuencode problem

I've this command to run ... Purpose : Send attachment file with e-mail body... ( E-mail body i read it from text file) uuencode TEST_FILE.csv TEST_FILE.csv | cat /usr/local/bin/EMAIL_BODY.txt - | mailx -s "TEST Report" -c receiver1@mail.com receiver2@mail.com Here is the... (2 Replies)
Discussion started by: prash184u
2 Replies

7. Shell Programming and Scripting

mailx problem

Hi Experts, Just need help maybe you have some time to spare :) I am having trouble creating a working script that will scan a file and mail specific persons I need to mail 5 persons person1,person2,person3,person4,person5 Person1,person2 I need to put them in the TO: field while... (0 Replies)
Discussion started by: makaveli
0 Replies

8. UNIX for Dummies Questions & Answers

Mailx problem

I can send mail from my Sun Solaris 9 box via the mail gui no problem. If I try it from mailx command line, the mail doesn't send. What might be causing this? thanks. (5 Replies)
Discussion started by: FredSmith
5 Replies

9. UNIX for Dummies Questions & Answers

mailx problem

Is there a size limit on the file that can be sent using mailx? I'm trying mailx -s "alertlog" tome@work < /dir/my.log and I only get a portion of the log. The newest portion of the log is not included in the mail. Additionally, I would like the option of mailing just the last 100... (1 Reply)
Discussion started by: djbartkow
1 Replies

10. UNIX for Dummies Questions & Answers

mailx problem

Here is a question I have, maybe someone can help me out. I am new to this UNIX thing. :) I have a file called elist. In this file is a list of 25 email adresses. How can I write a simple command line for that will read the names of the file and send it to each of the email addys. Can I... (2 Replies)
Discussion started by: iastorms
2 Replies
Login or Register to Ask a Question