Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 


Go to solution


I have a HP9000 in 11.0
I would like to create a script which send a mail to my Windows account.I have a workstation in Win2000 and the HP servers have no domain.
Ian Dennison_1
Honored Contributor

Re: Sendmail

If you have already configured the Sendmail system to talk to your Windows Mail Server, the command to send a mail is,...

where /tmp/textfile is the text to be sent. Alternatively you can specify a "To:" address in the first line of the textfile, and use the '-f' option of sendmail.

if you have not yet set up mail relaying, here are some starter posts,...,,0x1d93107d277ad611abdb0090277a778c,00.html,,0xfefda12d6d27d5118fef0090279cd0f9,00.html,,0xa8b014a24fd1d4118fef0090279cd0f9,00.html

This is a very big area to look at.

Share and Enjoy! Ian
Building a dumber user
Trusted Contributor

Re: Sendmail


If you installed unix, I think in all variants sendmail gets installed as well. The important thing to do is to set your mailserver.

Just change in the /etc/mail/ you mailhost :
# "Smart" relay host (may be null)
So f.e.:

If you use your Windows machine here (must be a smart relay !!) There is another way to use some more advantage of sendmail :

echo "From: $sender" > $TMP/file.$$
echo "To: $recepient" | /usr/bin/tr -cd '[\040-\176]' >> $TMP/file.$$
echo "" >> $TMP/start-mail.$$
echo "Subject: $subject" | /usr/bin/tr -cd '[\040-\176]' >> $TMP/file.$$
echo "" >> $TMP/start-mail.$$
echo "$message" | /usr/bin/tr -cd '[\040-\176]' >>/$TMP/file.$$
echo "\n." >>/$TMP/file.$$

cat $TMP/file.$$ - | /usr/lib/sendmail -odq -t
/bin/rm -f $TMP/start-mail.$$

This script allowes you to set your own sender adres, To adres, subject and message. Make sure you use the 'echo "\n."' This means it is the end of the message, but must start at the beginning of the new line. It works very nice.

If you need any more help, please let us know.

Regs David
Trusted Contributor

Re: Sendmail


Made a couple mistakes here :

1) TMP=/tmp
2) $$ is a standard for current process, so should not be defined. Leave it as it is.
3) the tr command converts bad characters
4) /bin/rm -f $TMP/start-mail.$$ should be :
/bin/rm -f $TMP/file.$$

5) I think it is clear that you must add your windows machine behind the DS, or your smart relay server. I didn't finish my sentence before I started a new subject.

Must be monday morning :)

Regs David

Re: Sendmail

The mail server is running. if i want to send a mail to me, i have :
NIS map mail.aliases specified,but NIS not running:Socket operation on non socket.
I don't want to use NIS.
My user is on a winNT domain perhaps should i notice the DNS server addrs.


Re: Sendmail

You should change your aliases entry in the /etc/nsswitch.conf from:

aliases files nis


aliases files

If you don't have an /etc/nsswitch.conf, create one out of the examples within the /etc directory or see "man nsswitch.conf".
Steven E. Protter
Exalted Contributor

Re: Sendmail

This one can even include attachements.

Steven E Protter
Owner of ISN Corporation

Re: Sendmail

Thanks for the hint. I'm a newbie to this forum and didn't notice.

So here is an example of a nsswitch.conf for files only, which could help hopefully.