LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
Search this Thread
Old 05-01-2008, 02:56 PM   #1
pramka
Member
 
Registered: May 2007
Location: ny
Distribution: fedora
Posts: 33

Rep: Reputation: 15
mailx


Can't get mailx to work. trying to send a mail to root@localhost that Scriptx was executed ..
mailx -u root@localhost "Scriptx was executed"
Can anyone tell me what I am doing wrong
..Thanks
 
Old 05-01-2008, 03:05 PM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Check the syntax. It should be
Code:
mailx -s "Scriptx was executed" root@localhost
then you're expected to type the text to include in the mail body and press Ctrl-D. If you want to put this in a shell script, you can use a "here document" like this
Code:
mailx -s "Scriptx was executed" root@localhost << EOT
some text here
some text here
some text here
EOT
 
Old 05-01-2008, 04:02 PM   #3
pramka
Member
 
Registered: May 2007
Location: ny
Distribution: fedora
Posts: 33

Original Poster
Rep: Reputation: 15
mailx -s root@localhost << EOT
Subject: Script executed
Can u see this here
Can u see this here
EOT

Does not want to work
 
Old 05-01-2008, 04:18 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,508

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Quote:
Originally Posted by pramka View Post
mailx -s root@localhost
The -s option is to specify the subject on the command line. You have to strip it out. Look carefully at the mailx manual page.
 
  


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
mailx comand ajatiti Linux - Enterprise 2 03-27-2008 10:15 AM
mailx csaunders Red Hat 1 05-23-2007 08:55 AM
mailx question bubba112557 Suse/Novell 1 12-17-2006 09:50 PM
installing mailx skverma_in Linux - Software 2 11-25-2004 10:56 PM
Configure Mailx Gerardoj Linux - Software 0 10-04-2003 09:09 PM


All times are GMT -5. The time now is 03:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration