Results 1 to 4 of 4
There is a command called "mail" that I was trying to use, where you can email a textfile or message to an e-mail address, but I can't seem to get ...
- 10-23-2006 #1Linux Newbie
- Join Date
- Sep 2006
- Location
- Arizona
- Posts
- 123
command line e-mailing
There is a command called "mail" that I was trying to use, where you can email a textfile or message to an e-mail address, but I can't seem to get it to work. The syntax is:
mail <options> <email address> < <textfile>
I tried this but it wouldn't send anything to my e-mail address ( I use yahoo mail)
Also you can do:
mail <options> <email address> (then hit enter)
(then type a message here followed by cntrl+d to send)
-but I was wondering if you could simply do it all on the same line(because I want to use it in a script), without having to hit cntrl+d. For example, would this work?:
mail -s "This is the subject" 1@2.com "This is my one line message" <enter>
any help on getting it to work would be awesome, or if you know any other commands I could use for this type of job. Thanks
- 10-23-2006 #2Just Joined!
- Join Date
- Oct 2006
- Posts
- 6
Go to System/Administration/Sever Settings/Services to make sure the SendMail MTA is running. If you are not using SendMail as your MTA, you need to make sure that MTA is running. Many people like using Postfix as an alternative MTA.
For the Cont-D, you can try "here" documents. But the problem is how to enter cont-D in here document?
- 10-24-2006 #3Just Joined!
- Join Date
- Oct 2006
- Posts
- 4
Originally Posted by infinet_e
try 'mailq', you can see what are the errors.
--
Vladimir
http://unix-news.blogspot.com
- 10-24-2006 #4Just Joined!
- Join Date
- Oct 2006
- Location
- Burnsville, Minnesota
- Posts
- 4
Try:
Code:echo "This is my one line message" | mail -s "This is the subject" 1@2.com


Reply With Quote