Click to See Complete Forum and Search --> : using mail


lazy_cod3R
04-27-2001, 10:10 PM
hello ,
can some one just post the simple line in which to send mail through the command line
with the senders, recipients and body of the email..

thanx

Craig McPherson
04-27-2001, 10:29 PM
You can use the mail command with only an e-mail address as an argument, and it'll propmt you for the subject and message body, like this:

mail sales@microsoft.com

Or you can set the subject on the command line, like this:

mail -s 'You are Communist' sales@microsoft.com

(Don't forget the quotes) It'll then prompt you for the message body. Use a "." on a blank line to signal that you're finished entering the message body.

Or if you have a short message body, you can feed it in directly via standard input, like this:

echo 'You are all Communists, I tell you' | mail -s 'Followup to previous message' sales@microsoft.com

That'll dump you straight back to a prompt -- the message will be sent with no further action required by you.

Read the manpage for "mail" if you need to know more.

lazy_cod3R
04-27-2001, 10:36 PM
na thats baiclly all i needed to know. i just need it in a script thats all ..


thanx

Energon
04-28-2001, 01:42 AM
do you need a mail daemon running to use that feature of mail?

Craig McPherson
04-28-2001, 01:55 AM
Yes.