1758674 Members
2108 Online
108874 Solutions
New Discussion юеВ

problem with sendmail

 
SOLVED
Go to solution
praveen..
Super Advisor

problem with sendmail

Hi,
I have sendmail configured on my server.
but i am not able to send the mail

i am typing this :
#mailx -s "TEST Mail" praveen@mycompany.com
hi, this is a test mail


please let me know what ahould i type after typing the "mail" word in the message.
if i type ctrl-c twice, it cancenlled the process,
how can i get the # promt again
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: problem with sendmail

Shalom praveen,

try this:

echo "I want my email now" | mailx -s "TEST Mail" praveen@mycompany.com

A mail will go into the system immediately.

tail -f /var/adm/mail.log

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: problem with sendmail

Hi Praveen,

Try Ctrl-d
or
# mailx -s "TEST MAIL" praveen@mycompany.com < myfile

Regards,
Robert-Jan
Sandman!
Honored Contributor

Re: problem with sendmail

Hi Praveen,

You need to type Ctrl-D (hold down the Ctl key and then type D) on a line by itself i.e.

# mailx -s "TEST Mail" praveen@mycompany.com
hi, this is a test mail


~hope it helps
Darrel Louis
Honored Contributor

Re: problem with sendmail

Hi,

To check if sendmail or mail-relay is working, try the following:

sendmail -v praveen@mycompany.com
Hi,
This is a tes mail
.

#Note: the dot at the last line is needed.
You'll then see the error-message if there is a problem with relay.

Have you also checked your mail.log or syslog file for mail errors?

GoodLuck

Darrel
Michael Steele_2
Honored Contributor

Re: problem with sendmail

Did you start your sendmail?

ps -ef | grep -i sendmail

start sendmail

sendmail -bq -q30m

stop sendmail

killsm

If you are still have problems then check $DS in your sendmail.cf file for the correct mail relay.

killsm
vi sendmail.com
/DS (* until you come to $DS and verify the entry *)
$DSmail.rely.com
exit
sendmail -bq -q30m

You should also check to see if your mail.rely.com is in /etc/hosts and that your /etc/nsswitch.conf and /etc/resolv.conf are correct. Also note that this is for a non DNS network. Do you have a DNS?
Support Fatherhood - Stop Family Law
James R. Ferguson
Acclaimed Contributor

Re: problem with sendmail

Hi Praveen:

As noted, you can either redirect the 'mailx' STDIN, as with an 'echo' into a pipe:

# echo "hello!" | mailx ...

...or place your message into a file:

# mailx -s "my subject" root < /tmp/message

...or if the subject alone is sufficient:

# mailx -s "call me!" praveen < /dev/null

...or type your message at the command line and enter (usually) a CTRL_D to single the end-of-file:

# mailx -s "please read what follows" praveen
Here is line-1 to read
and this is another line
and finally I don't have anymore to say!
CTRL_D

You do *not* need 'sendmail' running as a daemon to send outgoing mail from your server. If you aren't acting as a mail server you can simply not start 'sendmail' at boot time by setting:

SENDMAIL_SERVER=0

...in 'etc/rc.config.d/mailservs'

...and stopping the 'sendmail' daemon:

# /sbin/init.d/sendmail stop

Regards!

...JRF...
praveen..
Super Advisor

Re: problem with sendmail

i need to type