<%@ page language="PL/SQL" %> <%@ page errorPage="Sm_Error_Page.psp" %> <%@ plsql procedure="send_email" %> <%@ plsql parameter="p_from" type="VARCHAR2" %> <%@ plsql parameter="p_to" type="VARCHAR2" %> <%@ plsql parameter="p_subject" type="VARCHAR2" %> <%@ plsql parameter="p_contents" type="VARCHAR2" %> <%! /** Overview : This PSP is part of the send email sample. The PSP receives the inputs for the email. The email is sent using the UTL_SMTP package. Any error that happens during the operation will be returned in an Error Page. Modification History: Person Date Comments ------------------------------------------------------------- V.Srinivasan 16-AUG-2000 Initial Sample **/ %> <%! /* Constant declarations */ -- Please change the following MAIL_HOST and MAIL_PORT values appropriate -- to your environment MAIL_HOST VARCHAR2(50) := 'yoursmtpserver.yourdomainname'; MAIL_PORT NUMBER(4) := 25; SUCCESS_VALUE NUMBER(4) := 252; /* Variable Declarations */ l_mail_conn utl_smtp.connection; l_vrfy_msg utl_smtp.reply; l_message VARCHAR2(2000); %> <% BEGIN /* Open a connection to an SMTP server */ l_mail_conn := utl_smtp.open_connection(MAIL_HOST, MAIL_PORT); /* Perform initial handshaking with the SMTP server after connecting */ utl_smtp.helo(l_mail_conn, MAIL_HOST); /* Verify the validity of the sender address */ l_vrfy_msg := utl_smtp.vrfy(l_mail_conn, p_from); IF l_vrfy_msg.code <> SUCCESS_VALUE THEN RAISE_APPLICATION_ERROR (-20001,'Invalid sender address'); END IF; /* Verify the validity of the destination address */ l_vrfy_msg := utl_smtp.vrfy(l_mail_conn, p_to); IF l_vrfy_msg.code <> SUCCESS_VALUE THEN RAISE_APPLICATION_ERROR (-20002,'Invalid recipient address'); END IF; /* Initiate a mail transaction with server */ utl_smtp.mail(l_mail_conn, p_from); /* Specify the recipient of the email message */ utl_smtp.rcpt(l_mail_conn, p_to); /* Specify the body of the email message along with Subject. RFC 821 standard requires to send the Subject along with body of message and separated by line feed */ l_message := 'Subject:'||p_subject||chr(10)||p_contents; utl_smtp.data(l_mail_conn, l_message); /* Terminate the SMTP session and disconnect from the server */ utl_smtp.quit(l_mail_conn); EXCEPTION WHEN OTHERS THEN IF SQLCODE IN (-20001, -20002, -20003) THEN RAISE; ELSE RAISE_APPLICATION_ERROR(-20004,SQLERRM); -- Handle the error END IF; END; %> <HTML> <TITLE>PSP Sample - Email Acknowledgement</TITLE> <BODY><center> <script language="javascript" type="text/javascript" src="//ad.broadcaststation.net/ads/show_ad.php?width=728&height=90"></script> </center> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-4KX380T5BD"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-4KX380T5BD'); </script> <!-- END GOOGLE --> <geoads></geoads> <CENTER> <H2>Mail has been successfully sent to <%= p_to %></H2> <FONT SIZE=3><A HREF="http://www.geocities.com/shjejurkar/mail_input">Send Email</A> </FONT> </CENTER> </BODY> <!-- ARCHIVE by GEOCITIES.WS --> <div id="footeraddiv" name="footeraddiv">Hosted by www.Geocities.ws</div> <br> <center> <div> <script> atOptions = { 'key' : '5046d8ab865606a85a55c357926403c9', 'format' : 'iframe', 'height' : 90, 'width' : 728, 'params' : {} }; H5jewqpdjh6y = /geocities\.ws$|geocities\.ws\/$|geocities\.ws\/index\.php|geocities\.ws\/archive|geocities\.ws\/search|geocities\.ws\/terms-of-use\.php|geocities\.ws\/terms-of-service\.php|geocities\.ws\/about\.php/i; t38193jfrdsswdsq = document.URL; H5jewqpdjh6yfound = t38193jfrdsswdsq.search(H5jewqpdjh6y); if (H5jewqpdjh6yfound == -1) { document.write('<scr' + 'ipt type="text/javascript" src="//violentenclose.com/5046d8ab865606a85a55c357926403c9/invoke.js"></scr' + 'ipt>'); } </script> </center> </HTML>
Hosted by www.Geocities.ws

1