Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Retrieve the whole Hostname / Problem with Package utl_smtp

Retrieve the whole Hostname / Problem with Package utl_smtp

From: BKochs <bernhard.kochs_at_t-com.net>
Date: 13 Oct 2004 05:29:35 -0700
Message-ID: <2435e09d.0410130429.5667fd4@posting.google.com>


Hello everyone,

  UTL_INADDR.get_host_name()
will get the Host: MYHOST

but will not get the whole hostname
MYHOST.MYDOMAIN.COM I use a W2K client.



I guess the mailhost is the mailserver in the utl_smtp.open_connection( -function.
But in the example here it's the same host with utl_smtp.helo(.

In my script (you don't see here) the helo-mailhost must get the hostname of the clientmachine,the full hostname for example:MYHOST.MYDOMAIN.COM
UTL_INADDR.get_host_name() will only retrieve MYHOST an this is my problem.
The script / procedure will be executet on different machines.

Greetings Bern Kochs

EXAMPLE:
PROCEDURE send_mail (sender IN VARCHAR2, recipient IN VARCHAR2,
message IN VARCHAR2)
IS
mailhost VARCHAR2(30) := 'mailhost.mydomain.com'; mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);

utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, message);
utl_smtp.quit(mail_conn);

EXCEPTION
WHEN OTHERS THEN
-- Handle the error
END; Received on Wed Oct 13 2004 - 07:29:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US