LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE 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
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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



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
Configure Mailx Gerardoj Linux - Software 1 05-11-2016 02:52 AM
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 / openSUSE 1 12-17-2006 09:50 PM
installing mailx skverma_in Linux - Software 2 11-25-2004 10:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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