Bob :-)
The first two lines are reserved for the Subject. Try to insert a blank
line after the Subject.
Jan
I had exactly your problem just the other day when testing UTL_SMTP out.
Please find below soething which works :o)
The answer is to make sure that there is one line containing
UTL_TCP.CRLF in it between where you want the header to finish and the
body to begin.
Cheers,
Norman.
CREATE OR REPLACE PROCEDURE email_test_message
IS
--
-- MAILHOST is your own email server
-- SENDER can actually be ficticious !
-- RECIPIENT is obvious, and should really exist !
--
mailhost VARCHAR2(64) := 'lnewton.leeds.lfs.co.uk';
sender VARCHAR2(64) := 'TA...@lhawking.com';
recipient VARCHAR2(64) := 'Norman...@lfs.co.uk';
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);
--
-- The receivers are simply a list of people who WILL get the message.
-- Putting a list of names in the CC entry makes no difference at all -
they won't get the message
-- unless that are in a list of receivers.
--
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.rcpt(mail_conn, 'ora...@BountifulSolutions.co.uk');
--
-- Write some stuff to appear in the FROM, TO, CC, SUBJECT fields of the
email.
-- These are all of course, ficticious - SENDER above determines who
gets what.
--
utl_smtp.open_data(mail_conn);
utl_smtp.write_data(mail_conn, 'Subject: Message from Tam!'||
utl_tcp.CRLF);
utl_smtp.write_data(mail_conn, 'To: TAMDB Administrators'||
utl_tcp.CRLF);
utl_smtp.write_data(mail_conn, 'From: Busty Beryl - play with these
at your peril'|| utl_tcp.CRLF);
utl_smtp.write_data(mail_conn, 'CC: nick.b...@lfs.co.uk'||
utl_tcp.CRLF);
--
-- Separate the header from the body by a blank line.
-- Otherwise, the body will be embedded in the header - not very useful
!
--
utl_smtp.write_data(mail_conn, utl_tcp.CRLF);
utl_smtp.write_data(mail_conn, /*CHR(10)||*/'Hello, this is TAMDB
calling - are you there ?' || utl_tcp.CRLF);
utl_smtp.close_data(mail_conn);
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN OTHERS THEN
-- Insert error-handling code here
NULL;
END;
/
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman...@LFS.co.uk
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
hth.
--
Vladimir Zakharychev (b...@dpsp-yes.com) http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.
"Bob" <bo...@yahoo.com> wrote in message news:1m2t9.549845$v53.23...@news3.calgary.shaw.ca...
Hi Bob
We have implemented a package using UTL_SMTP which works successfully.
We pass the body of the message into the procedure as a parameter,
along with the To address, From address and Subject. Within the
procedure we concatenate all these parameters, including the message
body, into one string. We then use UTL_SMTP.WRITE_DATA to send the
string to the mail host.
The procedure is based on the example which you can find on Metalink.
HTH
H
Bob :-)
"Bob" <bo...@yahoo.com> wrote in message
news:1m2t9.549845$v53.23...@news3.calgary.shaw.ca...
Bob :-)
"Bob" <bo...@yahoo.com> wrote in message
news:1m2t9.549845$v53.23...@news3.calgary.shaw.ca...
--
Vladimir Zakharychev (b...@dpsp-yes.com) http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.
"NorwoodThree" <norwoo...@my-deja.com> wrote in message
news:ba03e2c.0210...@posting.google.com...
been there, had the problem, found the fix !
The demo routine in the Oracle manual neglegts the CRLF between the
header & body - which can be a tad upsetting, if you don't know what to
do to fix it !
Cheers,
Norman.
-------------------------------------
Norman Dunbar
Database/Unix administrator
Lynx Financial Systems Ltd.
mailto:Norman...@LFS.co.uk
Tel: 0113 289 6265
Fax: 0113 289 3146
URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Bob [mailto:bo...@yahoo.com]
Posted At: Thursday, October 24, 2002 3:30 AM
Posted To: server
Conversation: Oracle Email Procedure