1834704 Members
2882 Online
110069 Solutions
New Discussion

sendmail

 
rudy_4
Advisor

sendmail

i want to send an email from unix to a user on another mail server in the company how can i do that
4 REPLIES 4
MARTINACHE
Respected Contributor

Re: sendmail

Hi,

Set the DS macro in /etc/mail/sendmail.cf config file c:

DS yourserver.yourdomain

Then restart sendmail :

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

Then

mailx -s "subject" email@address.com
blabla
blabla
.

Regards,

Patrice.
Patrice MARTINACHE
Jeff Schussele
Honored Contributor

Re: sendmail

Hi Rudy,

If you know the users fully qualified address ie username@company.com AND if the UNIX system you are on is configured to relay mail then:

1) Compose the msg with an editor -such as vi - save it as a file EX filename.txt

2) Use mailx to send it:

#cat filename.txt | mailx -s "subject line" username@company.com

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Robin Wakefield
Honored Contributor

Re: sendmail

Hi,

You should be able to send directly, assuming the remote machine allows it:

echo hello | mailx -s "message to user" username@remotehost

if remotehost is resolvable from your machine.

Rgds, Robin.
Aftab Sadiq
Advisor

Re: sendmail

Hi Rudy,

- Make a backup of /etc/mail/sendmail.cf
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bk
- Edit sendmail.cf file
- Search for Foo.COM and replace it with your domain name or remove Foo.COM if you don't have a domain name (leave the dot there after $w)
for example if i have domain mydomain.com
then line will be
Dj$w.mydomain.com
- Search DS and specify smpt server
for example (smtp_sever is name of smtp sever)
# "Smart" relay host (may be null)
DSsmpt_server
- restart sendmail
/usr/init.d/sendmail stop
/usr/init.d/sendmail start

- test email (send /etc/hosts file)
cat /etc/hosts | mailx -s "subject" myemail@smtp_server

I hope it will help

Aftab