Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-08-2008, 04:40 PM   #1
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 472

Rep: Reputation: 30
sendmail : How to email contents of a text file?


I have stored a few things in a text file running redhad server on a remote machine. I know it's running sendmail. So, is it possible to send myself an email from remote command line with the contents of that text file?

Old 03-08-2008, 04:52 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910

cat file|mail -s "file content"

Old 03-08-2008, 05:08 PM   #3
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 472

Original Poster
Rep: Reputation: 30
I hit the command above. But I am not getting that email to my hotmail (or gmail) account at all. Is there a way to find out if that mail was ever sent?
Old 03-08-2008, 06:02 PM   #4
LQ Newbie
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0

You can check if your mail was sent or not by "mailq" command.
If your mail still on the server, you should be sure that if sendmail service running or not. You can control it by "service sendmail status"
If it is not working, you can start it by "service sendmail start"

Yunus Olgun
Old 03-08-2008, 07:11 PM   #5
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Yo ushould be able to see some indication of either sending or errors in the mail log
Old 03-09-2008, 08:27 PM   #6
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 165Reputation: 165
If your version of the mail command supports it, you can use the -v (verbose) switch so that as mail sends your message you get the conversation it has with the mail server displayed on your screen.



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
How-to list contents of text file in alphabetical order? sucram2g Linux - Software 1 02-19-2007 03:39 AM
cutting down contents of text file kam_kenneth Linux - Newbie 2 05-22-2004 01:16 AM
tar from contents of a text file trpn Linux - General 3 03-08-2004 01:05 AM
How to read and change the contents of a text file? Bassam Linux - General 11 02-26-2004 04:08 AM
using sendmail I can't send email in Rich Text Format robmainella Linux - Software 4 09-09-2003 10:33 AM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration