LinuxQuestions.org
Help answer threads with 0 replies.
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, 10: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, 10: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, 10:38 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 67
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, 04:39 PM   #4
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

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 10:29 AM
mail settings in linux mail command cad Linux - General 1 01-27-2007 04: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 06:06 PM
mail is not delivered thru the mail command aadilkhan Linux - General 1 11-18-2003 05:37 PM
cannot receive mail -- mail command andy18 Linux - General 1 09-09-2003 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:33 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
Open Source Consulting | Domain Registration