send mail to to my address

Hi All

I need to send mail to my email @my Company Mail Server
the server I want to send from is Solaris 10, we have Exchange mail server.

what are the steps to do that ??

Thank you
Who is Participating?
dendobConnect With a Mentor Commented:
Establish the machine that you are/will be using as your email 'gateway'.

Is it a machine under your control, or is it at your ISP ?
2) 'equate' that machine's IP address (in your DNS or /etc/hosts) with the machine name 'mailhost' (and/or ''). If you are using /etc/hosts, then the line should look like this:

    " mailhost"

3) You could also 'grep' for the word 'mailhost' in your file and replace the line that looks like
"DSmailhost.$w" with ""

The first problem you are having is that while sending this email, your local sendmail is looking to connect to port 25 on the host 'mailhost' (this is a 'Sun-ism').
Since you have no host defined as 'mailhost' you cannot connect, and the mail fails.

So you either have to change the name of the host that sendmail is looking for (in the file), or DEFINE a host named 'mailhost' for the local sendmail to
connect to (in DNS, or the /etc/hosts file).

The PROPER way to do this is to have an MX record in DNS that points to the "mail exchanger' that your domain is supposed to be using.
This will either be a 'Mail hub' that you maintain, or the 'Mail hub' that your ISP told you to use to send mail.

There may yet be other problems, but you cannot discover them until you correct this one.

The following link will help you with the mailx command:

AmolConnect With a Mentor Commented:
mailx "your email id"
enter the subjet
enter the body text
<cntrl - d>

Check if you get the mail, if not you have to follow the steps what dendob has suggested.
Barry GillChief of StaffCommented:
do you want to do this for a user, from the command line, as part of a scripted process or provide details to an application that sends mail reports?
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Could you provide a more detailed explanation on what it is you want to do?
echo "From: <youremailaddress>
To: <recipientaddress.
Subject: <suject of the message>

<the message>
" | /usr/lib/sendmail -oi -t

omar2010Author Commented:
dendob your steps not clear to me, the Solaris machine I am talking about is under my control, when I execute "grep mailhost /etc/mail/"
I get this output:
O FallbackSmartHost=mailhost$?m.$m$.

amolg I try your step doesn't work as you said I should go with dendob steps first
barrulus yes I want to this as part of a scripted process.

arnold what I need to do is how to send mail from shell to my company mail address, I want to use this laster to send me alert to my email.

Thank you
Barry GillChief of StaffCommented:
find in your file the line that starts with "DS"
this line should read:

The hostname should be one that the soalris box can resolve internally.

Your mailserver should be available on port 25 as the DS line creates a smarthost and all mail not handled by the local machine will be delivered there.
Mohan ShivaiahCommented:
To send a mail from solaris to your company mail server
mailx -s "sujbect" <yourmailid@yourcompany_domain>
enter the body text
<cntrl - d>
mailx -s "sujbect" <yourmailid@yourcompany_domain>  < body_of_the_text
cat <body_of_the_text>  | mailx -s "sujbect" <yourmailid@yourcompany_domain>

body_of_the_text=create a file and put the content in this file.

Mohan ShivaiahCommented:
Make sure your solaris server has DS entry with the relay server details.
omar2010Author Commented:
Thank you
All Courses

From novice to tech pro — start learning today.