LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2012, 04:45 AM   #1
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Rep: Reputation: Disabled
Unable to send CC mail using mail command


Hi All,
I am using Ubuntu 12.04 and I am not able to send mail as cc. Here is test file
Code:
$cat test-mail 
#!/bin/bash
echo "This is a test mail."| mail -s "Testing CC" other@mydomain.com -c me@mydomain.com
And getting the below error
Code:
$bash test-mail 
mail: invalid option -- 'c'
Try `mail --help' or `mail --usage' for more information.
So please help me how to send CC mails in bash shell script.
Thanks in advance for your kind help.
 
Old 08-02-2012, 05:04 AM   #2
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 319

Rep: Reputation: 80
can you try
Code:
mail -s "Test" -c cc@domain.tld to@domain.tld
 
Old 08-02-2012, 07:24 AM   #3
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
Thanks Celyr,
Quote:
mail -s "Test" -c cc@domain.tld to@domain.tld
I had already tried the above but it is not working and giving the same above error. Could you please help me in this.

Last edited by roopakl; 08-02-2012 at 07:25 AM.
 
Old 08-02-2012, 07:45 AM   #4
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 319

Rep: Reputation: 80
It works to me, just tried, can you tell the output of
Code:
mail -V
 
Old 08-02-2012, 09:08 AM   #5
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
Thanks for the reply.
But it is not working for me.
Code:
$ mail -V
mail (GNU Mailutils 2.2)
 
Old 08-02-2012, 09:34 AM   #6
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 319

Rep: Reputation: 80
Because you have this mail http://mailutils.org/manual/mailutils.html#SEC69
try to use mailx with the same syntax
 
1 members found this post helpful.
Old 08-04-2012, 08:51 AM   #7
roopakl
Member
 
Registered: Sep 2011
Posts: 92

Original Poster
Rep: Reputation: Disabled
Thanks Celyr,
It is working.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian etch - Unable to send mail from command line or from php mail command lqforumuser Linux - Newbie 1 03-01-2009 07:56 AM
Unable to send emails using mail command alpha01 Linux - Server 13 08-29-2008 07:11 PM
can mail command be used to send mail onto global mail servers like yahoo etc dale_chip Linux - Newbie 4 08-12-2008 09:33 AM
unable to send mail using Mail command navin_karnam Linux - Newbie 3 05-13-2008 03:21 AM
Unable to send mail using mail command faruque.ahmed Linux - Software 1 02-03-2007 11:29 AM


All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration