Web Hosting Talk







View Full Version : sendmail question


stephenn
09-02-2002, 09:31 AM
hi .

what is the basic command to send a mail in command line, using
sendmail program.

somebody help me.

Thanks

Noldar
09-02-2002, 10:06 AM
You normally wouldn't use the sendmail program to send an email from the command line. Usually you would use something like the mail command.

#mail -s "This is the subject" recipient@domain.com
Type message here
CTRL-D when done

or if you want to send a file as the text of a message:

#mail -s "This is the subject" recipient@domain.com < /path_to/message.txt

Richard

Hostnix
09-02-2002, 10:15 AM
Using sendmail directly:

/path/to/sendmail -f from@domain.com address@domain.com
<insert custom headers>
To: Someone <someone@domain.com>
From: Me <me@domain.com>
Subject: Hey!
</custom headers>
Type message. Blah blah blah.
.

That's it.... a period (.) on a line by itself sends the message. Put any customer headers you want in the beginning, where I've marked <insert custom headers> and they will be sent as a header.

Good luck.