LinuxQuestions.org
Review your favorite Linux distribution.
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-11-2008, 07:08 AM   #1
Swapna173
LQ Newbie
 
Registered: Dec 2007
Posts: 25

Rep: Reputation: 15
Mail command works on one server but not on other


Hi Guys,

mail command to attach a file works on one linux server machine. but the same command does not work on the other. May i know what can be the problem.

If any server settings to be done. what can be those.
 
Old 08-11-2008, 07:13 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Do you think it might be worth giving the exact commands, plus distro, error message, log output, etc?
 
Old 08-12-2008, 12:23 AM   #3
Swapna173
LQ Newbie
 
Registered: Dec 2007
Posts: 25

Original Poster
Rep: Reputation: 15
The command is as follows:


cat mailbody.txt | mail -s <<subject>> -a <<filetoattach>> <<emailid>>

It gives following Message:
mail: invalid option -- a
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[- sendmail-options ...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]

The server details are :
Linux kalam.in.vistaar.com 2.6.9-55.ELsmp #1 SMP Fri Apr 20 16:36:54 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
 
Old 08-12-2008, 12:26 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
The mail command does not have the -a option. I believe this is mutt or nail. With mail/mailx, you need to do your own encoding (eg: uuencode or mime encode).
 
Old 08-12-2008, 12:49 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Yep nail: http://linux.die.net/man/1/nail
 
  


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
Help me!!.. to create a new mail account in my server with command shell. darwinlinux Linux - Server 5 03-31-2008 08:21 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 07:37 AM
Is it my PHP command or a server issue with mail? DeeH Linux - Newbie 1 11-07-2007 03:44 PM
mail server help: *@www.x.com works, why not *@x.com? Alotau Linux - Server 19 04-19-2007 12:53 AM


All times are GMT -5. The time now is 06:24 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