runtime error ora-12703 when running utl_mail [message #416791] |
Tue, 04 August 2009 05:35 |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
hello,
I call a procedure through push button to use UTL_MAIL.send(..) and I got error ora-12703.
There is no error during compilation.
For your info, I manage to execute the same code on stored procedure using TOAD and I received the email sent using TOAD and telnet from my local.
Could anyone please help me on this.
Thanks,
Dayang
|
|
|
|
Re: runtime error ora-12703 when running utl_mail [message #416857 is a reply to message #416855] |
Tue, 04 August 2009 15:53 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Does Forms use a character set when connecting to the database? ( Don't know nothing about forms, but I had a somewhat similar problem sending mail once, and there it was a problem with the client character set. )
Maybe the character set from Toad matches the database character set, and the Forms one doesn't.
You could look in this AskTom thread for some hints on how to narrow down the problem.
|
|
|
|
|
|
|
Re: runtime error ora-12703 when running utl_mail [message #416925 is a reply to message #416791] |
Wed, 05 August 2009 03:31 |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
Hi David,
I'm sorry if I might ask s stupid question..
how could I know my MS Outlook's charset?
this is my MS Outlook version : Microsoft Office Outlook 2007 (12.0.4518.1014) MSO(12.0.6013.5000).
I tried to manipulate few charset such as utf-8, and iso-8859-1.
Both returned the same error.
However when I changed the charset in my procedure in TOAD, I could execute the procedure and received the emails.
For info, the db is locate at other server and I ran the form from my local machine.
I telnet to my db server as sys and 'ALTER SESSION SET smtp_out_server = 127.0.0.1'(my local machine)..
Regards,
Dayang
|
|
|
Re: runtime error ora-12703 when running utl_mail [message #416970 is a reply to message #416925] |
Wed, 05 August 2009 08:29 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
What text is the Forms procedure sending? I Toad you send
subject => 'me send tru toad',
MESSAGE => 'me send tru toad.. test',
Could it be that the data that Forms is sending has characters in it the Database Character set can't handle? Can you set the subject and message in the Forms procedure also to some "innocent" text?
|
|
|
|
Re: runtime error ora-12703 when running utl_mail [message #417105 is a reply to message #416791] |
Thu, 06 August 2009 01:36 |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
Hi All,
I tried another function that use utl_smtp to send email.
Again I could recieve email when I execute the function in TOAD but got error ora-12703 when I ran using forms.
When I ran the form, only "debug 1st" apear, then after that it returned error ora-12703.
Function:
Quote: | FUNCTION SEND_MAIL
(pIssuer IN VARCHAR2,
pReceiver IN VARCHAR2,
pSender IN VARCHAR2,
pSubject IN VARCHAR2,
pMessage IN VARCHAR2) RETURN VARCHAR2 IS
c utl_smtp.connection;
respuesta utl_smtp.reply;
pServer VARCHAR2(50) := '10.0.3.79';
CRLF CHAR(2) := CHR(13) || CHR(10);
BEGIN
message('debug 1st');
-- Abre la conexión al Server de correo
c := utl_smtp.open_connection(pServer);
message('debug2nd');
respuesta := utl_smtp.helo(c, pServer);
-- Inicia el Issuer del correo.
respuesta := utl_smtp.mail(c, pSender);
-- Inicia el Receiver
respuesta := utl_smtp.rcpt(c, pReceiver);
respuesta := utl_smtp.open_data(c);
-- Escribe la cabecera del e-mail
utl_smtp.write_data(c, 'From: ' || pIssuer || CRLF);
utl_smtp.write_data(c, 'To: ' || pReceiver || CRLF);
-- Escribe el Subject
utl_smtp.write_data(c, 'Subject: ' || pSubject || CRLF);
-- Escribe el texto del Message.
utl_smtp.write_data(c, CRLF || pMessage);
utl_smtp.write_data(c, CRLF || '.');
respuesta := utl_smtp.close_data(c);
-- Cierra la conexión
respuesta := utl_smtp.quit(c);
RETURN '0';
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
utl_smtp.quit(c);
RETURN sqlerrm;
--raise_application_error(-20000,
-- 'El envío del email ha fallado devolviendo el siguiente error: ' || sqlerrm);
END;
|
|
|
|
|
Re: runtime error ora-12703 when running utl_mail [message #417502 is a reply to message #416791] |
Sun, 09 August 2009 23:04 |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
Hi all,
Thanks for your responses and help. I do appreciate that.
Im not sure what is wrong with my utl_mail package. I still cannot send email using the package through my oracle forms.
Somehow I've another workaround solution to send the email.
Im using OLE2 in webutil.
Here is the code:
Quote: | DECLARE
objOutlook OLE2.OBJ_TYPE;
objMail OLE2.OBJ_TYPE;
objArg OLE2.LIST_TYPE;
mail varchar2(2000);
alert_button NUMBER;
BEGIN
mail:='Hello World';
objOutlook := OLE2.CREATE_OBJ('Outlook.Application');
objarg := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(objarg,0);
objMail := OLE2.INVOKE_OBJ(objOutlook,'CreateItem',objarg);
OLE2.DESTROY_ARGLIST(objarg);
OLE2.SET_PROPERTY(objmail,'To','dayangku.masmaryam@lityan.com.my');
OLE2.SET_PROPERTY(objmail,'Subject','Test Send Email');
OLE2.SET_PROPERTY(objmail,'Body',mail);
OLE2.INVOKE(objmail,'Send');
OLE2.INVOKE(objmail,'Display');
OLE2.RELEASE_OBJ(objmail);
OLE2.RELEASE_OBJ(objOutlook);
END;
|
It works..
Regards,
Dayang
|
|
|
|