cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Mail from HP Server

Dinesh_15
Frequent Advisor

Sending Mail from HP Server

Hi Gurus

I need a samm help. I am having two HP servers running 11.11. I want to know how can I send the mail to a perticular email the reports which generated thru scripts.

Can any body give me the step for configuring the same.
Consider the fllowing

server name: PRD
email id : user@testltd.com


Rgds
Dinu
8 REPLIES
Stf
Esteemed Contributor

Re: Sending Mail from HP Server

# echo test | sendmail -v user@testltd.com

Stf ;-)
Dinesh_15
Frequent Advisor

Re: Sending Mail from HP Server

Hi

Am getting the following error.

#echo test|sendmail -v user@testltd.com
WARNING: local host name (PRD) is not qualified; fix $j in config file
testltd.com: Name server timeout
user@testltd.com... Transient parse error -- message queued for future delivery
user@testltd.com... queued


Rgds
Dinu
Naveej.K.A
Honored Contributor

Re: Sending Mail from HP Server

Dinesh,

Edit the /etc/mail/sendmail.cf file and put your host name after Dj with no spaces.you should specify the fqdn here.

Djprd.xyz.com

Also don't forget to include the Smart Relay host in the configuration file. It should specified in the DS macro., like

DSrelayhost.com

Make sure that these host names are getting resolved (either through /etc/hosts or through the DNS).


Regards,
--Naveej
practice makes a man perfect!!!
Naveej.K.A
Honored Contributor

Re: Sending Mail from HP Server

oooops... I forgot.

After you make changes in the sendmail configuration file, don't forget to restart sendmail.

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


Regards,
--Naveej
practice makes a man perfect!!!
renarios
Trusted Contributor

Re: Sending Mail from HP Server

Hi Dinu,

Here are some examples:

Mail No attachment, body only -

mailx -m -s "Some Subject" somone@somewhere.com < file_for_email_body

Mail with attachement, no body -

ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com

Mail with attachment and body -

ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com < file_for_email_body

Mail with carbon and blind carbon -

mailx -m -s "Some Subject" somone@somewhere.com < file_for_email_body

(the file_for_email_body should look like this - )
~c someone_to_cc@somewhere.com
~b someone_to_bc@somewhere.com
The remainder of this file is the text body of the email.

Mail as another sender

echo "Hello" | mailx -m -s "Greeting" -r Santa.Claus@north_pole.com someone@somewhere.com

Mail with multiple attachments (The sentence "This is all you get." will appear as the body.)

mailx -m -s "Hello" someone@somewhere.com << END
`ux2dos /home/some_file | uuencode some_file.txt`
`ux2dos /home/some_other_file | uuencode some_other_file.txt`
This is all you get.
END

Is this enough? If you need more info, jut give some more input.

Cheerio,

Renarios
Nothing is more successfull as failure
Rita C Workman
Honored Contributor

Re: Sending Mail from HP Server

Ahhh..one of my favorite subjects.

There a a few ways you can mail attachments from the host. But some methods will cause your attachment to become part of the body of the email, and often that is not the desired result.

Here is url and within are pointers to others that give you a variety to choose from.
For myself....I'm a big fan of using the 'include' statement. We find it scripts up so nicely to send any kind of file as a true attachment (free).

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=198775

Rgrds,
Rita
Steven E. Protter
Exalted Contributor

Re: Sending Mail from HP Server

Attaching my personal favorite script for this task.

Many tools can do this job.

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
Bejoy C Alias
Respected Contributor

Re: Sending Mail from HP Server

Try 'sendmail -bv user@testltd.com', which will check whether the mail is deliverable and how it will deliver ( local or relay ).
See whether it is using the local delivery agent or a relaying delivery agent . Check whether testltd.com is resolving in the server from where u r sending the mail . Do u have dns configured in the server from which u r sending the mail ?
Be Always Joy ......