Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Return Receipt with UTL_SMTP mail

62170Feb 5 2002
Hi,
I know how to send a email with PL/SQL using the UTL_SMTP package. However can anybody tell me what I need to put into the email header in order to get a Return Receipt confirmation that the email has been successfully delivered and read by the other end. The following is my PL script for the same :

CREATE PROCEDURE MAILTEST
IS
conn UTL_SMTP.CONNECTION;
mailhost VARCHAR2(64) := 'mailhost.server.com';
abcd VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
mesg VARCHAR2(4000);
usrname VARCHAR2(30);
usraddr VARCHAR2(100);
subj VARCHAR2(100);
body_of_msg VARCHAR2(100);
recaddr VARCHAR2(100);

BEGIN

usrname:= 'John Doe';
usraddr:= 'john@yahoo.com';
recaddr:= 'matt@yahoo.com';
subj:= 'This is a PL/SQL Email Test';
body_of_msg := '<HTML><BODY><B><I>This is a PL/SQL Email Test from oradb1p</I></B></BODY></HTML>';

mesg:= 'Date: ' || TO_CHAR(SYSDATE, 'dd Mon yy hh24:mi:ss') || utl_tcp.crlf ||
'From: ' || usrname || ' <' || usraddr || '>' || utl_tcp.crlf ||
'Subject: ' || subj || utl_tcp.crlf ||
'Content-Type: text/html' || utl_tcp.crlf ||
'X-Priority: 1' || utl_tcp.crlf;

mesg:= mesg || utl_tcp.crlf || body_of_msg;
conn:= utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(conn,mailhost);
utl_smtp.mail(conn, usraddr);
utl_smtp.rcpt(conn,recaddr);
utl_smtp.data(conn, mesg);
utl_smtp.quit(conn);

EXCEPTION
WHEN others THEN
RAISE;

END;

Thanks,
Kiron
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 7 2002
Added on Feb 5 2002
3 comments
2,149 views