LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-08-2008, 04:40 PM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

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


Hello,

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?

TIA.
 
Old 03-08-2008, 04:52 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Sure.

cat file|mail -s "file content" you@domain.com



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

Original Poster
Rep: Reputation: 30
Tinkster!
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
yunusolgun
LQ Newbie
 
Registered: Mar 2008
Posts: 1

Rep: Reputation: 0
Hi,

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"

Regards,
Yunus Olgun
 
Old 03-08-2008, 07:11 PM   #5
billymayday
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
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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.
 
  


Reply

Tags
sendmail


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

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

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