LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sendmail : How to email contents of a text file? (https://www.linuxquestions.org/questions/linux-newbie-8/sendmail-how-to-email-contents-of-a-text-file-626665/)

concoran 03-08-2008 04:40 PM

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.

Tinkster 03-08-2008 04:52 PM

Sure.

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



Cheers,
Tink

concoran 03-08-2008 05:08 PM

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?

yunusolgun 03-08-2008 06:02 PM

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

billymayday 03-08-2008 07:11 PM

Yo ushould be able to see some indication of either sending or errors in the mail log

gilead 03-09-2008 08:27 PM

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.


All times are GMT -5. The time now is 06:23 PM.