Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending mail

Status
Not open for further replies.

tjbradford

Technical User
Dec 14, 2007
229
GB
i would like to send mail from the shell prompt

i have read a few examples but none of them show it with a destination ip address or hostname just the email address, how to i over come this , or exchange server is authentication only, but we have an smtp-anon server that forwards unauthenticated mail.

i'm stuck and cant find any examples
 
You're trying to send an email without using an email address? Can you provide more detail about what exactly you're trying to do?

This works for me
Code:
 echo "email body" | mail -s "subject" "recipient@gmail.com"

-----------------------------------------
I cannot be bought. Find leasing information at
 
the above "your example" is exactly what i tried, the question is really how does that route to the exchange server or how do i stop it routing to the exchange server and point it to the smtp anon server ?

i tried the above with @10.10.10.1 but this didn't give the desired affect.

how does it know how to the smtp server ?
 
arrrrr so there is a configuration file ?

none of the examples i looked at mentioned this !

where is this badboy then ?
 
I don't have access to a server I can test this out on, and it's not something I've ever done before. But I think the directions at this link should be what you need.

-----------------------------------------
I cannot be bought. Find leasing information at
 
if I understand things correctly
sending mail form the command line your system will be attempting to send the mail direct to the MTA at the destination domain

ie if you are sending to test@somewhere.com then your server will attemp to resolve somewhere.com & deliver directly.

if you wish this to relay through an internal server first you would need to reconfigure your locat MTA (usualy sendmail or postfix)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top