-   Linux - Software (
-   -   Sending email with a Linux Server (

bwtoh 09-13-2004 02:50 AM

Sending email with a Linux Server
I want to send email out to the Internet with command line (actually from a shell script). I just want to send a simple email with no more than 2 lines.

I tried something like
echo "XXX Message" |mail -s "XXX Subject"
But my Linux server failed to deliver the email.
I know my syntax above is right as I have successfully sent an email with another Linux server.

System Config :
Red Hat Linux ver 8.0.

After combing the net for answers, I noticed that there are a few commands related to mails : mail, sendmail, qmail, etc etc.

Can anyone explain or point me to a tutorial that explains these different mail commands ? Differences ? :scratch:

Why can't I send my email ? I know there could be quite a number of possible problems like network config not set properly... but can anyone give me a guideline on what/how to check ?

What does it take for the mail command to work ?

Thanks a lot.

r0b0 09-13-2004 08:10 AM

First, you will need a mail transfer agent (a.k.a. mail server) to be able to send and receive e-mail on the server.
I would suggest you first install 'postfix' from your distribution media and try your mail example again.

dcj1mmy 09-13-2004 12:39 PM

When you think you have everything on the local server correct with mail. Try using :

sendmail -v (email addy )

And then another period to confirm you done your email. This will verbosly connected to the desired email server. You can see there if it connects to send the mail or not.

Also check your hosts file, make sure you have the following listed in there.

email_server_ip = email server you are trying to email or forward mail to

Hostname - email servers host name

domain name of email addy.

bwtoh 09-14-2004 02:36 AM

r0b0, thanks for attempting to help.
How do I check whether postfix is already installed ? how do I check that it has been started?

dcj1mmy, thanks for attempting to help.

I am still not clear as to how to go about solving this prob.

All times are GMT -5. The time now is 04:34 PM.