LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-2005, 05:47 AM   #1
ozymandias
Member
 
Registered: Aug 2005
Location: West Midlands, UK
Posts: 61

Rep: Reputation: 15
How can I send an email to myself?


How can I send an email to he root account?

For example, I have a script which greps the login log for illegal attempts at ssh login - if I wanted to send the results of this to root@localhost, which command do I use?
I couldn't find much on this in the tutorials.. hence asking a simple question!
 
Old 09-24-2005, 02:06 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Use the mail command, e.g.

grep <whatever> | mail -s "My subject line" root@localhost
 
Old 09-24-2005, 02:34 PM   #3
ozymandias
Member
 
Registered: Aug 2005
Location: West Midlands, UK
Posts: 61

Original Poster
Rep: Reputation: 15
doh!

Thanks - I'd looked at the man mail page but couldn't figure out how to automate the message contents... simple when you know how!
 
  


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
email 'send' NO - email 'receive' YES..? captain skywave Linux - Wireless Networking 4 04-23-2005 03:35 AM
email 'send' YES - email 'receive' NO..? captain skywave Linux - Wireless Networking 1 04-22-2005 05:23 AM
Can't send email... distortedstar Linux - Software 3 03-25-2004 08:54 PM
Allowing an IP to send email using my email server... culprit Linux - Networking 7 09-09-2003 12:24 PM
Need to send email linuxRules Linux - General 4 07-12-2002 01:57 PM

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

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