Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Send email whith oracle

Re: Send email whith oracle

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 28 Nov 2005 10:02:25 -0800
Message-ID: <1133200938.972591@yasure>


Alen Cappelletti wrote:
> Hi all,
> I write from Italy and with this procedure I want send a E-mail from
> Oracle.
> Ok, all works fine except the messagge body.
>
> -------
> 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, p_sender) ;
> utl_smtp.rcpt(l_mail_conn, p_recipient ) ;
> utl_smtp.open_data(l_mail_conn) ;
>
>
> --
> -- Write the header
> --
> utl_smtp.write_data(l_mail_conn, v_header);
> 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;
>
>
> -----------------
> CALL IT...
> BEGIN
> send_mail_alen(
> 'cocker_at_libero.it',
> 'alen.cappelletti_at_it.scc.com',
> 'cocker_at_libero.it,aaa_at_llll.it',
> 'Oggetto del messaggio',
> 'saaaaaaaaaaaaaaaaaalve...');
> END;
>
> I have Notes client and the only field black is my message body.
> Someone have a solution or a TIP?
>
> TNKS ALen

Nowhere do you seem to assign a value to: v_message. I'd be looking for a line such as:

v_message := 'My message';

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Nov 28 2005 - 12:02:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US