send e-mail [message #381929] |
Tue, 20 January 2009 05:55  |
imuharram
Messages: 48 Registered: January 2009
|
Member |
|
|
I have an issue in an application that I want develop.
It's an application for following up work orders that are generated from a department, gets the approval from head of unit. After the approval it is sent to the destination department and after the task that is required in the work order is completed, they change the status from "Pending" to "Done".
My inquiry is I need an e-mail to be sent to the destination unit members through microsoft outlook or some kind of notification so they could know that there is a work order that needs to be checked. In addition, after the work has been checked to be "Done", I need an e-mail to be sent back to the originating unit members to be notified that the work order has been completed.
How could I automate sending an e-mail through outlook or have an instant notification or alert to inform the user of receiving the work order or changing its status.
we have oracle 10g, outlook 2007
|
|
|
Re: send e-mail [message #381967 is a reply to message #381929] |
Tue, 20 January 2009 08:22   |
kamar_19
Messages: 52 Registered: June 2005 Location: pakistan
|
Member |
|
|
hi
dear u can send mail by oracle form developer using utl_smtp utility .
please c procedure.
PROCEDURE SEND_Email(P_mailfrom varchar2,P_Mailto Varchar2,P_Subject Varchar2,P_Message Varchar2) IS
C Utl_Smtp.Connection;
BEGIN
C := Utl_Smtp.Open_Connection('smtp_server_name');
Utl_Smtp.Helo(C, 'domain_name');
Utl_Smtp.Mail(C, P_mailfrom);
Utl_Smtp.Rcpt(C, P_Mailto);
Utl_Smtp.Open_Data(C);
utl_smtp.write_data(c, 'From: ' || P_mailfrom || utl_tcp.crlf);
utl_smtp.write_data(c, 'To: ' || p_mailto || utl_tcp.crlf);
utl_smtp.write_data(c, 'Subject: ' || p_subject || utl_tcp.crlf);
utl_smtp.write_data(c, 'Content-Type: text/html' || utl_tcp.crlf);
utl_smtp.write_data(c, utl_tcp.crlf || p_message);
Utl_Smtp.Close_Data(C);
Utl_Smtp.Quit(C);
EXCEPTION
WHEN Utl_Smtp.Transient_Error OR Utl_Smtp.Permanent_Error THEN
Utl_Smtp.Quit(C);
RAISE_APPLICATION_ERROR(-20000,'FAILED TO SEND MAIL DUE TO THE FOLLOWING ERROR: ' || SQLERRM);
when others then
RAISE_APPLICATION_ERROR(-20001,'Some problem Exist: ' || SQLERRM);
END;
regards
Qamar Abbas
|
|
|
|
|
|