Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Send email whith oracle
If you like you can look at the routine that I collectively put together regarding email and oracle. Hit me up with an email or
visit my site. It is free for the taking. We currently use the same mail process in our production environment... about 2 years
going now.
On 29 Nov 2005 01:09:04 -0800, "Alen Cappelletti" <cocker_at_libero.it> wrote:
>OK, thanks Andy...
>now I'write my BODY message but no v_header.
>
>------
>CREATE OR REPLACE PROCEDURE send_mail_alen(
> v_sender in varchar2,
> v_recipient in varchar2,
> v_ccrecipient in varchar2,
> v_subject in varchar2,
> v_message in varchar2
> )
>AS
> crlf VARCHAR2(2) := UTL_TCP.CRLF;
> l_mailhost varchar2(255) := '10.138.0.15' ;
> l_mail_conn utl_smtp.connection ;
> v_header varchar2(1000);
>
>BEGIN
> --
> -- Start the connection.
> --
> l_mail_conn := utl_smtp.open_connection(l_mailhost, 25) ;
>
> v_header:= 'Date: '||TO_CHAR(SYSDATE,'dd Mon yy hh24:mi:ss')||crlf||
> 'From: '||v_sender||''||crlf||
> 'Subject: '||v_subject||crlf||
> 'To: '||v_recipient||crlf||
> 'CC: '||v_ccrecipient;
>
>
> --
> -- Handshake with the SMTP server
> --
> utl_smtp.helo(l_mail_conn, l_mailhost) ;
> utl_smtp.mail(l_mail_conn, v_sender) ;
> utl_smtp.rcpt(l_mail_conn, v_recipient ) ;
> utl_smtp.open_data(l_mail_conn) ;
>
>
> --
> -- Write the header
> --
> utl_smtp.write_data(l_mail_conn, v_header||crlf);
> utl_smtp.write_data(l_mail_conn, crlf||v_message ) ;
> utl_smtp.close_data(l_mail_conn) ;
> utl_smtp.quit(l_mail_conn );
> --dbms_output.put_line('Message send to the user successfully') ;
>END;
BChase
bsc7080mqcXX_at_mylxhhq.com
(remove XX to contact)
Extra 500 megabytes space when using the below coupon code http://www.servage.net/?coupon=cust11668