LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 09-24-2007, 11:21 AM   #1
louisJ
LQ Newbie
 
Registered: Jun 2007
Posts: 16

Rep: Reputation: 0
command mail in sciprts


hi

how to send a mail to james@univ.com with the subject "hello" jsut in one line of command in a bash script?

thanks
 
Old 09-24-2007, 11:28 AM   #2
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 370

Rep: Reputation: 44
mail -v -s hello james@univ.com
 
Old 09-24-2007, 11:38 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
What MTA (Mail Transport Agent) do you use? If you have none installed and configured, you need to do that first. Once you have a working MTA installed, you can install a command line mail client, like mailx. If this is the route you choose, then you can send mail very easily like this:

Code:
echo "Body of your message" | mailx -s "Subject here" jr@bobdobbs.com
 
Old 09-24-2007, 05:39 PM   #4
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,546

Rep: Reputation: 57
Quote:
Originally Posted by louisJ View Post
hi

how to send a mail to james@univ.com with the subject "hello" jsut in one line of command in a bash script?

thanks
http://www.linuxquestions.org/questi...ghlight=nbsmtp
with gmail
 
  


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
Unable to send mail using mail command faruque.ahmed Linux - Software 1 02-03-2007 11:29 AM
mail settings in linux mail command cad Linux - General 1 01-27-2007 05:23 AM
Cannot send mail with mail() command in PHP 4.3.4, Apache 2.0.48, Mandrake Linux 10 arcanum Linux - General 3 06-27-2004 07:06 PM
mail is not delivered thru the mail command aadilkhan Linux - General 1 11-18-2003 06:37 PM
cannot receive mail -- mail command andy18 Linux - General 1 09-09-2003 04:13 PM


All times are GMT -5. The time now is 05:43 PM.

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