Sending mails using plsql program

I am trying to send an email to personal id using plsql program. I have written a code in plsql using UTL_TCP package where opens the connections and then senda a mail. But when i execute the program mails are not being sent.

I typed "mail" command on the unix box and got the below result

From MAILER-DAEMON Mon Sep 18 07:03:41 2006
Date: Mon, 18 Sep 2006 07:03:41 +0100 (BST)
From: Mail Delivery Subsystem <MAILER-DAEMON>
Message-Id: <200609180603.k8I63fOH029965@hwnej05.>
To: <artiscat@hwnej05>
Subject: Returned mail: see transcript for details
Content-Length: 4339

This is a MIME-encapsulated message

--k8I63fOH029965.1158559421/hwnej05.

The original message was received at Mon, 18 Sep 2006 07:03:41 +0100 (BST)
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<amolm@techmahindra.com>
(reason: 550 Host unknown)

----- Transcript of session follows -----
550 5.1.2 <amolm@techmahindra.com>... Host unknown (Name server: mailhost: host
not found)

--k8I63fOH029965.1158559421/hwnej05.
Content-Type: message/delivery-status

Reporting-MTA: dns; hwnej05.
Received-From-MTA: DNS; localhost
Arrival-Date: Mon, 18 Sep 2006 07:03:41 +0100 (BST)
Final-Recipient: RFC822; amolm@techmahindra.com
Action: failed
Status: 5.1.2
Remote-MTA: DNS; mailhost
Diagnostic-Code: SMTP; 550 Host unknown
Last-Attempt-Date: Mon, 18 Sep 2006 07:03:41 +0100 (BST)

--k8I63fOH029965.1158559421/hwnej05.
Content-Type: message/rfc822

Return-Path: <artiscat@hwnej05>
Received: from hwnej05. (localhost [127.0.0.1])
by hwnej05. (8.12.10+Sun/8.12.10) with ESMTP id k8I63fOH029963
for <amolm@techmahindra.com>; Mon, 18 Sep 2006 07:03:41 +0100 (BST)
Received: (from artiscat@localhost)
by hwnej05. (8.12.10+Sun/8.12.10/Submit) id k8I63fLW029962
for amolm@techmahindra.com; Mon, 18 Sep 2006 07:03:41 +0100 (BST)
Date: Mon, 18 Sep 2006 07:03:41 +0100 (BST)
From: Artisan Application user <artiscat@hwnej05>
Message-Id: <200609180603.k8I63fLW029962@hwnej05.>

Could you please let me know what should i do to get rid of this problem.

I just know basics of Unix. Hence finding it difficult to resolve the problem.

Thanks & Regds
Amol

The error is telling you that the host techmahindra.com can't be found in DNS.
Your code is okay, it's a DNS issue either on their side or yours (if that is a valid host).

Send a test email from hwnej05 to the email address:
$ mailx -s"test" youraddress@techmahindra.com < /dev/null

If you get the same type of error, then you know that your code was okay (as long as the spelling of the techmahindra.com is correct).

Then try to look up the mx address of techmahindra.com
$ nslookup
> set type=mx
> techmahindra.com

You should get info such as

If you don't get a response on the lookup, then your DNS isn't finding the MX record of the domain you are trying to send to and the email won't be sent.

Thanks for the replay.

I tried to type the below command but getting error !!

$ nslookup
ksh: nslookup: not found

What OS and version are you using? You can try /usr/sbin/nslookup but it may not be in that directory on your OS.

Version is Sun OS 5.9 and below is the o/p for the command /usr/sbin/loopup

Default Server: icore-rylcr-55.nexus.btintra.com
Address: 147.149.2.69

You need to re-run the nslookup command and set the MX and lookup the domain you were trying to find. All you put as the output of the command was the default message which shows which dns server you are pointing to run lookups against. The parts in bold are what you type

$nslookup
>set type=mx
>techmahindra.com
this will give you the output to post in this thread...
>exit