Sending e-mail prior to Ora 8.0 from PL/SQL

Dear peers,
I would like to e-mail from a Pl/SQL block but can't use utl_smtp because the Oracle version is prior to 8.0. Could you recommend ways of doing so?
My OS is Unix and have Perl,and PHP as well. I have little experience with any of this tools, so please be simple.
Any suggestions would be greatly appreciated.
Thanks, CIP

Hi,
The following article on sending mail is for Oracle 7.x as well and is specific to UNIX. It uses DBMS_PIPE PL/SQL package, a PRO*C program and UNIX sendmail utility for sending e-mail. For this, the database you are using should have DBMS_PIPE package installed.
Hope that helps,
Srinivas
ARTICLE : How to Generate E-mail within PL/SQL Routines?
References
For DBMS_PIPE/architecture, refer to the following:
"Oracle7 Server Application Developer's Guide" (A32536-1)
"Oracle8 Application Developer's Guide Release 8.0" (A58241-01)
"Oracle8i Supplied PL/SQL Packages Reference Release 2 (8.1.6)" (A76936-01)
Preparation
Perform the steps below to setup the necessary files.
Note: When testing on your machine, the code generates simple
e-mail messages for demonstration purposes.
1. Read the main comment block of maildaemon.pc and make appropriate
changes.
2. Read the main comment block of maildaemon.sql and make appropriate
changes.
3. Connect to SQL*Plus. If not already setup, GRANT EXECUTE ON DBMS_PIPE TO
where userid is public or the schema owner of the package.
4. Run maildaemon.sql to setup dependencies.
5. Copy proc.mk (demo_proc.mk on v8 databases) into directory and issue
the following make line to build the executable for maildaemon:
make -f proc.mk build EXE=maildaemon OBJS=maildaemon.o
PROCFLAGS="sqlcheck=semantics parse=full userid=scott/tiger"
Note: Replace userid=scott/tiger with the schema to build under.
6. Run the maildaemon executable.
7. To test, modify the code below and run from SQL*Plus:
declare
dummy number;
begin
maildaemon.setauditon;
dummy:= maildaemon.email_msg1( '[email protected]' );
dummy:= maildaemon.email_msg2( '[email protected]', 'scott',
to_char( sysdate, 'dd-Mon-yyyy hh:mi:ss' ));
maildaemon.setauditoff;
maildaemon.stop;
end;
maildaemon.sql
rem file: maildaemon.sql
rem last modified: 10/15/98
rem
rem This source file generates dependencies for the maildaemon executable
rem such as logging as well as the PL/SQL package interface to communicate
rem with the maildaemon Pro*C application.
rem
rem Please note: this is just a sample. You will need to modify/replace the
rem email_msg1() and email_msg2() functions in the maildaemon package.
rem Both functions have been provided as simple demonstrations on how to
rem write an interface. Consult the Application Developers Guide for more
rem information on using the DBMS_PIPE package.
rem table: emailaudit
rem purpose: contain auditing messages from the maildaemon Pro*C application
create table emailaudit
msgid number constraint msgid_pk primary key,
msgtype varchar2( 20 ),
msgstat varchar2( 100 )
rem sequence: emailmsgseq
rem purpose: to allow maildaemon Pro*C application to generate unique message
rem identifiers for opening temporary files and auditing.
create sequence emailmsgseq;
rem package: maildaemon
rem purpose: provide a PL/SQL interface to generate e-mail messages
create or replace package maildaemon as
/* setauditon( )
* procedure
* parameters: timeout: timeout factor for informing the maildaemon exe
* exceptions: -20030: error sending message to maildaemon exe
* description: turn on auditing in the maildaemon exe
procedure setauditon( timeout number default 10 );
/* setauditoff( )
* procedure
* parameters: timeout: timeout factor for informing the maildaemon exe
* exceptions: -20030: error sending message to maildaemon exe
* description: turn off auditing in the maildaemon exe
procedure setauditoff( timeout number default 10 );
/* stop( )
* procedure
* parameters: timeout: timeout factor for informing the maildaemon exe
* exceptions: -20030: error sending message to maildaemon exe
* description: shutdown the maildaemon exe
procedure stop( timeout number default 10 );
/* email_msg1( )
* function
* parameters: emailaddr: email address to send email to
* timeout: timeout factor for informing the maildaemon exe
* returns: return code from mail daemon call
* exceptions: -20010: maildaemon had an error during sending email
* -20011: error during sending message to maildaemon exe
* -20012: message returned from maildaemon other than done
* -20013: maildaemon returned an error code other than 0
* description: generic sample to demonstrate a simple interface to the
* maildaemon exe
function email_msg1( emailaddr in varchar2, timeout number default 10 ) return number;
/* email_msg2( )
* function
* parameters: emailaddr: email address to send email to
* userid: userid to place in the mail text
* timestamp: timestamp to place in the mail text
* timeout: timeout factor for informing the maildaemon exe
* returns: return code from mail daemon call
* exceptions: -20010: maildaemon had an error during sending email
* -20011: error during sending message to maildaemon exe
* -20012: message returned from maildaemon other than done
* -20013: maildaemon returned an error code other than 0
* description: generic sample to demonstrate a simple interface to the
* maildaemon exe by passing parameters
function email_msg2( emailaddr in varchar2, userid in varchar2, timestamp in varchar2,
timeout number default 10 ) return number;
end maildaemon;
create or replace package body maildaemon as
procedure setauditon( timeout number default 10 ) is
retval number;
begin
dbms_pipe.pack_message( 'AUDIT' );
retval := dbms_pipe.send_message( 'maildaemon', timeout );
if retval <> 0 then
raise_application_error( -20030,
'maildaemon: error sending audit command. Status = ' &#0124; &#0124; retval );
end if;
end setauditon;
procedure setauditoff( timeout number default 10 ) is
retval number;
begin
dbms_pipe.pack_message( 'NOAUDIT' );
retval := dbms_pipe.send_message( 'maildaemon', timeout );
if retval <> 0 then
raise_application_error( -20030,
'maildaemon: error sending noaudit command. Status = ' &#0124; &#0124; retval );
end if;
end setauditoff;
procedure stop( timeout number default 10 ) is
retval number;
begin
dbms_pipe.pack_message( 'STOP' );
retval := dbms_pipe.send_message( 'maildaemon', timeout );
if retval <> 0 then
raise_application_error( -20030,
'maildaemon: error sending stop command. Status = ' &#0124; &#0124; retval );
end if;
end stop;
function email_msg1( emailaddr in varchar2, timeout number default 10 ) return number is
retval number;
result varchar2(20);
cmdcode number;
pipenm varchar2(30);
begin
pipenm := dbms_pipe.unique_session_name;
dbms_pipe.pack_message( 'MSG1' );
dbms_pipe.pack_message( pipenm );
dbms_pipe.pack_message( emailaddr );
retval := dbms_pipe.send_message( 'maildaemon', timeout );
if retval <> 0 then
raise_application_error( -20010,
'maildaemon: error while sending email. Status = ' &#0124; &#0124; retval );
end if;
retval := dbms_pipe.receive_message( pipenm, timeout );
if retval <> 0 then
raise_application_error( -20011,
'maildaemon: error while receiving daemon response. Status = ' &#0124; &#0124; retval );
end if;
dbms_pipe.unpack_message( result );
if result <> 'done' then
raise_application_error( -20012,
'maildaemon: error code returned from daemon other than done' );
end if;
dbms_pipe.unpack_message( cmdcode );
if cmdcode <> 0 then
raise_application_error( -20013,
'maildaemon: error code returned from daemon ' &#0124; &#0124; cmdcode );
end if;
return cmdcode;
end email_msg1;
function email_msg2( emailaddr in varchar2, userid in varchar2, timestamp in varchar2,
timeout number default 10 ) return number is
retval number;
result varchar2(20);
cmdcode number;
pipenm varchar2(30);
begin
pipenm := dbms_pipe.unique_session_name;
dbms_pipe.pack_message( 'MSG2' );
dbms_pipe.pack_message( pipenm );
dbms_pipe.pack_message( em ailaddr );
dbms_pipe.pack_message( userid );
dbms_pipe.pack_message( timestamp );
retval := dbms_pipe.send_message( 'maildaemon', timeout );
if retval <> 0 then
raise_application_error( -20010,
'maildaemon: error while sending email. Status = ' &#0124; &#0124; retval );
end if;
retval := dbms_pipe.receive_message( pipenm, timeout );
if retval <> 0 then
raise_application_error( -20011,
'maildaemon: error while receiving daemon response. Status = ' &#0124; &#0124; retval );
end if;
dbms_pipe.unpack_message( result );
if result <> 'done' then
raise_application_error( -20012,
'maildaemon: error code returned from daemon other than done' );
end if;
dbms_pipe.unpack_message( cmdcode );
if cmdcode <> 0 then
raise_application_error( -20013,
'maildaemon: error code returned from daemon ' &#0124; &#0124; cmdcode );
end if;
return cmdcode;
end email_msg2;
end maildaemon;
maildaemon.pc
* file: maildaemon.pc
* last modified: 10/15/98
* This source code is written for the UNIX environment to allow PL/SQL
* to generate e-mail. Please note, the following code might not work on
* your system due to configurations of the operating system or your
* environment. Please consult your systems administrator for more
* information on specifics.
* Variables to be set prior to building:
* mailhost: the mail application to generate email queuing. Default is
* "/usr/lib/sendmail".
* mailswitch: the mail application switches to pass to $mailhost. Default
* is "-t".
* userpass: the username/password to connect to the database. Default is
* "scott/tiger"
* logfile: the logfile to write system messages to.
* Functions to be modified:
* main( ): will need to modify the message handling portion to handle the
* messages from the maildaemon package (PL/SQL). The changes that need
* to be made are in the else if( ... ) portion with handling MSG1 and
* MSG2.
* msg1( ): this is just a stub sample. Replace this with appropriate code
* and change the call in main( ).
* msg2( ): this is just a stub sample. Replace this with appropriate code
* and change the call in main( ).
* System include files
#include <stdio.h>
#include <string.h>
EXEC SQL INCLUDE sqlca;
* Global variable declaration
EXEC SQL BEGIN DECLARE SECTION;
char *mailhost = "/usr/lib/sendmail";
/* the mail host application to gen email requests */
char *mailswitch = "-t";
/* switches to pass to $mailhost */
char *userpass = "scott/tiger";
/* userid/password to connect to the database as */
char *logfile = "maildaemon.log";
/* log file to write messages to */
FILE *loghnd = NULL;
/* file pointer to log file */
int retval;
/* return value for DBMS_PIPE send */
int calval;
/* return value set from DBMS_PIPE receive */
varchar pipeid[ 30 ];
/* return pipe identifier */
char filename[ 128 ];
/* filename to use for email */
varchar command[ 20 ];
/* system command received from DBMS_PIPE receive */
char syscommand[ 2000 ];
/* hold system command for generating email request */
varchar emailaddr[ 256 ];
/* hold the email address for sending message to */
int auditing= 0;
/* set whether auditing is to be done */
varchar string1[ 256 ];
/* hold string 1 passed from server */
varchar string2[ 256 ];
/* hold string 2 passed from server */
EXEC SQL END DECLARE SECTION;
* Function definition
* conerr( )
* handle connection error
void conerr( )
char msgbuf[ 512 ]; /* message buffer */
int msglen; /* message buffer space used */
int maxmsglen; /* maximum message length */
EXEC SQL WHENEVER SQLERROR CONTINUE;
sqlglm( msgbuf, &maxmsglen, &msglen );
fprintf( loghnd, "maildaemon: error during connect to database\n" );
fprintf( loghnd, "error reported: %.*s\n", msglen, msgbuf );
fprintf( loghnd, "maildaemon: aborting...\n" );
exit( 1 );
} /* end conerr( ) */
* sqlerr( )
* handle general SQL error
* does not cause maildaemon to abort
void sqlerr( )
char msgbuf[ 512 ]; /* message buffer */
int msglen; /* message buffer space used */
int maxmsglen; /* maximum message length */
EXEC SQL WHENEVER SQLERROR CONTINUE;
sqlglm( msgbuf, &maxmsglen, &msglen );
fprintf( loghnd, "maildaemon: error during processing\n" );
fprintf( loghnd, "error reported: %.*s\n", msglen, msgbuf );
fprintf( loghnd, "maildaemon: continuing...\n" );
} /* end sqlerr( ) */
* msg1( )
* stub function example 1 for sending an email.
int msg1( )
EXEC SQL BEGIN DECLARE SECTION;
int retcode = 0; /* return code */
long msgid; /* unique message id */
FILE msghnd = NULL; / file handle to write email file */
EXEC SQL END DECLARE SECTION;
if( emailaddr.len == 0 )
{ /* null address passed */
fprintf( loghnd, "maildaemon: null address specified to msg1( )\n" );
retcode= 999;
return( retcode );
} /* end if */
/* get the next sequence number for uniqueness */
EXEC SQL WHENEVER SQLERROR GOTO sqlerror1;
EXEC SQL SELECT emailmsgseq.nextval INTO :msgid FROM dual;
/* generate the filename so it is unique and open the file */
sprintf( filename, "emailmsg.txt.%ld", msgid );
msghnd= fopen( filename, "w" );
if( msghnd == NULL )
{ /* there was an error opening the output file */
retcode= 1;
if( auditing )
{ /* set audit trail */
EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg1', 'maildaemon: status code of: ' &#0124; &#0124; :retcode );
EXEC SQL COMMIT;
} /* end if */
return( retcode );
} /* end if */
/* generate email */
fprintf( msghnd, "To: %s\n", emailaddr.arr );
fprintf( msghnd, "Subject: msg1 message type\n\n" );
fprintf( msghnd, "\tmsg1 message type was called for emailing\n" );
fprintf( msghnd, "\ngenerated by maildaemon\n" );
/* close the file */
fclose( msghnd );
/* create the command line and send the message */
sprintf( syscommand, "%s %s < %s", mailhost, mailswitch, filename );
retcode= system( syscommand );
/* remove the temporary file */
unlink( filename );
if( auditing )
{ /* set audit trail */
EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg1', 'maildaemon: status code of: ' &#0124; &#0124; :retcode );
EXEC SQL COMMIT;
} /* end if */
EXEC SQL WHENEVER SQLERROR CONTINUE;
return( retcode );
sqlerror1:
retcode= 1;
sqlerr( );
return( retcode );
} /* end msg1( ) */
* msg2( )
* stub function example 2 for sending an email.
int msg2( )
EXEC SQL BEGIN DECLARE SECTION;
int retcode = 0; /* return code */
long msgid; /* unique message id */
FILE msghnd = NULL; / file handle to write email file */
EXEC SQL END DECLARE SECTION;
if( emailaddr.len == 0 )
{ /* null address passed */
fprintf( loghnd, "maildaemon: null address specified to msg2( )\n" );
retcode= 999;
return( retcode );
} /* end if */
/* get the next sequence number for uniqueness */
EXEC SQL WHENEVER SQLERROR GOTO sqlerror2;
EXEC SQL SELECT emailmsgseq.nextval INTO :msgid FROM dual;
/* generate the filename so it is unique and open the file */
sprintf( filename, "emailmsg.txt.%ld", msgid );
msghnd= fopen( filename, "w" );
if( msghnd == NULL )
{ /* there was an error opening the output file */
retcode= 1;
if( auditing )
{ /* set audit trail */
EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg2', 'maild aemon: status code of: ' &#0124; &#0124; :retcode );
EXEC SQL COMMIT;
} /* end if */
return( retcode );
} /* end if */
/* generate email */
fprintf( msghnd, "To: %s\n", emailaddr.arr );
fprintf( msghnd, "Subject: msg2 message type\n\n" );
fprintf( msghnd, "\tmsg2 message type was called for emailing\n" );
fprintf( msghnd, "Userid of user: %s\n", string1.arr );
fprintf( msghnd, "Timestamp of transaction: %s\n", string2.arr );
fprintf( msghnd, "\ngenerated by maildaemon\n" );
/* close the file */
fclose( msghnd );
/* create the command line and send the message */
sprintf( syscommand, "%s %s < %s", mailhost, mailswitch, filename );
retcode= system( syscommand );
/* remove the temporary file */
unlink( filename );
if( auditing )
{ /* set audit trail */
EXEC SQL INSERT INTO emailaudit VALUES( :msgid, 'msg2', 'maildaemon: status code of: ' &#0124; &#0124; :retcode );
EXEC SQL COMMIT;
} /* end if */
EXEC SQL WHENEVER SQLERROR CONTINUE;
return( retcode );
sqlerror2:
retcode= 1;
sqlerr( );
return( retcode );
} /* end msg2( ) */
void main( )
/* open file and verify logging */
loghnd = fopen( logfile, "a" );
if( loghnd == NULL )
{ /* the logfile was unable to be opened */
printf( "maildaemon: error opening logfile (%s)\n", logfile );
exit( 1 );
} /* end if */
/* connect to the database */
EXEC SQL WHENEVER SQLERROR DO conerr( );
EXEC SQL CONNECT :userpass;
fprintf( loghnd, "maildaemon: connected.\n" );
/* loop until stop command given */
EXEC SQL WHENEVER SQLERROR DO sqlerr();
while( 1 == 1 )
{ /* inifinite loop */
/* reset values */
emailaddr.len = 0;
string1.len= 0;
string2.len = 0;
/* get type of message from 'server' */
EXEC SQL EXECUTE
begin
:calval := dbms_pipe.receive_message( 'maildaemon' );
if :calval = 0 then
dbms_pipe.unpack_message( :command );
end if;
end;
END-EXEC;
if( calval == 0 )
{ /* message received. determine the command */
command.arr[ command.len ]= '\0';
if( !strcmp(( char * ) command.arr, "STOP" ))
{ /* 'server' specified to stop */
fprintf( loghnd, "maildaemon: shutdown in progress...\n" );
break;
} /* end if */
else if( !strcmp(( char * ) command.arr, "AUDIT" ))
{ /* set auditing on */
fprintf( loghnd, "maildaemon: enable auditing...\n" );
auditing= 1;
} /* end else if */
else if( !strcmp(( char * ) command.arr, "NOAUDIT" ))
{ /* set auditing off */
fprintf( loghnd, "maildaemon: disable auditing...\n" );
auditing= 0;
} /* end else if */
else if( !strcmp(( char * ) command.arr, "MSG1" ))
{ /* call for message 1 */
/* retrieve the message */
EXEC SQL EXECUTE
begin
dbms_pipe.unpack_message( :pipeid );
dbms_pipe.unpack_message( :emailaddr );
end;
END-EXEC;
/* copy into host variable */
emailaddr.arr[ emailaddr.len ]= '\0';
/* generate the email */
retval= msg1( );
/* reply with response */
EXEC SQL EXECUTE
begin
dbms_pipe.pack_message( 'done' );
dbms_pipe.pack_message( :retval );
:retval := dbms_pipe.send_message( :pipeid );
end;
END-EXEC;
} /* end else if */
else if( !strcmp(( char * ) command.arr, "MSG2" ))
{ /* call for message 2 */
/* retrieve the message */
EXEC SQL EXECUTE
begin
dbms_pipe.unpack_message( :pipeid );
dbms_pipe.unpack_message( :emailaddr );
dbms_pipe.unpack_message( :string1 );
dbms_pipe.unpack_message( :string2 );
end;
END-EXEC;
/* copy into host variable */
emailaddr.arr[ emailaddr.len ]= '\0';
string1.arr[ string1.len ]= '\0';
string2.arr[ string2.len ]= '\0';
/* generate the email */
retval= msg2( );
/* reply with response */
EXEC SQL EXECUTE
begin
dbms_pipe.pack_message( 'done' );
dbms_pipe.pack_message( :retval );
:retval := dbms_pipe.send_message( :pipeid );
end;
END-EXEC;
} /* end else if */
else
{ /* invalid command received */
fprintf( loghnd, "maildaemon: illegal command... ignoring request.\n" );
} /* end else */
} /* end if */
else
{ /* time out error occured */
fprintf( loghnd, "maildaemon: timeout or other error while waiting for signal request.\n" );
} /* end else */
} /* end while */
/* clean up and exit */
EXEC SQL COMMIT WORK RELEASE;
fprintf( loghnd, "maildaemon: shutdown.\n" );
fclose( loghnd );
} /* end main( ) */
null

Similar Messages

  • How to send a mail prior to the due date

    Hi all,
                 I would like to send a mail prior to the due date. Please let me know how to go to the previous step after the loop is executed once in workflows.
    Thanks,
    Sirisha N.

    Hi all,
                 I would like to send a mail prior to the due date. Please let me know how to go to the previous step after the loop is executed once in workflows.
    Thanks,
    Sirisha N.

  • How to send a mail automatically based on a date from ORACLE database

    Hi,
    I want to send a mail automatically based on a date from ORACLE database.
    Please help me.
    thanks
    --Sara                                                                                                                                                                                                                                   

    programs are available on net to send mail directly from oracle ie procedure s in oracle sending mails

  • Sending SMTP mail using Mailgun does not work from Azure, but works from on premise

    I am using Mailgun to send email from my web application. When I test the application from my development box, the e-mail is sent and received I see the logs in Mailgun site as well. However, when I publish the code to Azure and send the e-mail, it is not
    sent. I don't see it in the Mailgun logs either.
    Is Azure blocking Mailgun SMTP? I appreciate any help.
    Thanks,
    Jay

    Hi Jay,
    From your description, I guess you may send mail via SMTP. I don't recommend you use SMTP method to send mail on Azure cloud service. You can use the MailGun API to send mail, Please refer to this document (https://documentation.mailgun.com/user_manual.html#sending-via-api
    ). Or you can use Sendgrid, please see this blog (http://blogs.msdn.com/b/patrick_butler_monterde/archive/2010/10/11/sending-e-mail-from-windows-azure-part-1-of-2.aspx).
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Sending e-mail only if the status changed from a specific status

    Hi Gurus,
    There are a lot of thereads about sending an e-mail when the status is changed to something...
    But ,Is there any way to check the <u>previous status</u> prior to send the e-mail?
    For example;
    I want to send an only e-mail to message processor when the status is changed from "customer action" to "In process" but not when the status is changed from "new" to "In process"
    In my opinion to achieve the scenario above there must be something else so-called "previous user status" in the condition creation screen. But there is no...
    Thanks in advance,
    Gencay

    Hi Suzi,
    You should select "Value of Item in Expression 1 = Expression 2" as condition in your mail processes. For the approved process, write Approved as Expression 2 in the condition, and Rejected for the rejected process. For both processes write P5_STATUS in Expression 1.
    Hope that helps.
    Regards,
    Sergio

  • When I send a mail with a picture I get from 4 to 17 in return to my trash can.

    What ca I do to avoid having from 4 to 17 copies of one mail sent with a photo added, returning to my trash basket in addition to one filed as a draft?

    Thank you, I find how to solve the problem thanks to your link.
    I try to send HTML E-mail so I had the From in the from field writen in the header of the mail and not to initialize the connection.
    sis2b.

  • Periodic Alert-How to send all the records returned from the SQL in a mail?

    Hello all,
    I have defined a Periodic Alert, my SQL query returns more than one record whenever I run it. I also defined an action to send an email with the message consisting of the output variables from the SQL. Whenever i run this alert, a mail is being sent for every single record returned from the query. But i want to send a single mail containing all the records information that my SQL query returns.
    For Example: My SQL query lists all the users created on current date.
    Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
    from fnd_users where trunc(creation_date) = trunc(sysdate)
    Now i want to send a mail with all the users information from the above query, to SYSADMIN. How can this be achieved?
    Thanks & Regards
    chakoo

    Hi Chakoo,
    If the Periodic Alert is not working as requried. You can write a simple package with 3 procedures to implement the writing output to a out file and simultaneuosly send email to multiple receiptents.
    Example:
    Create Package xx_pac
    Create public Procedure P1
    begin
    Select User_Id, User_Name into &OUTPUT1, &OUTPUT2
    from fnd_users where trunc(creation_date) = trunc(sysdate)
    fnd_file.put_line (fnd_file.output, &OUTPUT1, &OUTPUT2);
    end;
    (Create private Procedure P2
    begin
    ---Write the email package using the UTL_SMTP approch. Using this approch you can send the procedure P1 output file as an attachment to the desiginated receiptents.
    end;
    (Create public Procedure P3
    begin
    ---call the procedure P1 using the "g_request_id = fnd_request.submit_request"
    ---Wait for the above procedure to complete using "l_conc_status := fnd_concurrent.wait_for_request" procedure.
    ---call the procedure P2. (When called you must provide the correct to, from address)
    end;
    end;
    Register the Package xx_pac as a concurrent program and schedule when submit it from the request.
    Regards
    Arun Rathod

  • Sending remote mail in solution manager 3.2

    Hi all,
    I have a problem with sending remote mails with the client 002 (copy from 001 for support desk). If I want send a remote mail in the work place to another satellite system i get the error message "Address does not exist". I think SCOT is correctly configured, because the remote mail in Client 000 works. But the Message does not appear in the Queue from SCOT...
    I hope you understand my english :).
    Can please someone help me?
    Lionel
    Message was edited by: Lionel Mischler

    I found it...
    SAP NOTE 327202
    run report RSSODIAD

  • Cant send picture mail on my Sprint 8330

    When I try to send picture mail I'm asked to pick from a contact list, which is empty. I can't find instructions on how to add someone to the contact list for picture mail. Can anyone help?
    Thanks!

    Are you trying to mail someone by attaching pictures?
    If so then you need to have pictures in your picture folder. Now compose a new email and click Menu and select Attach File -> Choose your desired pictures and click trackball. You're done!
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • ORA-28500: connection from ORACLE to a non-Oracle system

    Hi, I need to connect to a OWB mysql database, but when making a query in sql plus sends me this error.
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][H006] The init parameter
    <HS_FDS_CONNECT_INFO> is not set. Please set it in init<orasid>.ora file.
    ORA-02063: preceding 2 lines from MYSQLINK
    listener.ora
    # listener.ora Network Configuration File: C:\oraclebi\db\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
         (SID_NAME = PLSExtProc)
         (ORACLE_HOME = C:\oraclebi\db)
         (PROGRAM = extproc)
         (SID_DESC =
         (SID_NAME = MYSQL)
         (ORACLE_HOME = C:\oraclebi\db)
         (PROGRAM = hsodbc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = bi.oratechla.com)(PORT = 1521))
    tnsnames.ora
    # tnsnames.ora Network Configuration File: C:\oraclebi\db\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    BISE1DB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = bi.oratechla.com)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = bise1db)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    OTCL_MORDOR =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.31.210)(PORT = 1620))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = TEST)
    MYSQL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = bi.oratechla.com)(PORT = 1521))
    (CONNECT_DATA =
    (SID = MYSQL))
    (HS = OK)
    inithMYSQL.ora
    # This is a sample agent init file that contains the HS parameters that are
    # needed for an ODBC Agent.
    # HS init parameters
    HS_FDS_CONNECT_INFO = MYSQL
    HS_FDS_TRACE_LEVEL = off
    # Environment variables required for the non-Oracle system
    #set <envvar>=<value>
    system dsn --> MYSQL
    databaselink
    CREATE PUBLIC DATABASE LINK mysqlink CONNECT TO "oracle" IDENTIFIED BY "oracle" using 'ejemplo';
    Database link created.
    select * from empleado@mysqlink;
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specified
    or
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][H006] The init parameter
    <HS_FDS_CONNECT_INFO> is not set. Please set it in init<orasid>.ora file.
    ORA-02063: preceding 2 lines from MYSQLINK
    tnsping
    C:\Documents and Settings\Administrator>tnsping MYSQL
    TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 06-AUG-2
    010 06:31:57
    Copyright (c) 1997, 2005, Oracle. All rights reserved.
    Used parameter files:
    C:\oraclebi\db\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = bi.orate
    chla.com)(PORT = 1521)) (CONNECT_DATA = (SID = MYSQL)) (HS = OK))
    OK (30 msec)

    Use the setup failing with
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][H006] The init parameter
    <HS_FDS_CONNECT_INFO> is not set. Please set it in init<orasid>.ora file.
    ORA-02063: preceding 2 lines from MYSQLINK
    There is a typo in the name of you gateway init file. You posted the content of inithMYSQL.ora but the naming is init<SID>.ora which is in your case initMYSQL.ora.
    In addition please keep in mind HSODBC has been desupported since 2008 and when starting a new configuration you should use the follow up product dg4odbc (Database Gateway for ODBC) V11.

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • Send E-mail from Oracle (9.2.0.1) : SMTP transient error: 421 Service not a

    I have used Oracle 9i server (9.2.0.1 version) on Windows XP machine(with SP2).I want to send Email from PL/SQL procedure.
    My Question is what sort of configuration needed to perform this activity?
    I have installed IIS (Internet Information Service)
    in my machine, then configure my SMTP mail server
    with a valid email id and password given TCP port 465.
    Later I came to know that to send Email from PL/SQL I have to install Oracle JServer Code. Follow three steps. the steps are
    1. Execute the script as sys "$ORACLE_HOME\javavm\install\initjvm.sql"
    2. Execute the loadjava classfile as
    $ORACLE_HOME\plsql\jlib>loadjava -f -v -r -u sys/**** plsql.jar
    3. Execute the script as sys "$ORACLE_HOME\rdbms\admin\initplsj.sql"
    I sucessfully executed the first step, but for the second step iam not able to locate the plsql.jar file in the specified path.
    So Please tell me if there is any other method to perform this task
    My code is as follows.
    CREATE OR REPLACE PROCEDURE SEND_MAIL (
                                  msg_to varchar2,
                                  msg_subject varchar2,
                                  msg_text varchar2
                                  IS
                                  c utl_smtp.connection;
                                  rc integer;
                                  msg_from varchar2(50) := '[email protected]';
                                  mailhost VARCHAR2(30) := 'mail.google.com';
                             BEGIN
                                  c := utl_smtp.open_connection(mailhost, 465);
                                  utl_smtp.helo(c, mailhost);
                                  utl_smtp.mail(c, msg_from);
                                  utl_smtp.rcpt(c, msg_to);
                                  dbms_output.put_line(' Start Sending data');
                                  utl_smtp.data(c,'From: Oracle Database' || utl_tcp.crlf ||
                                  'To: ' || msg_to || utl_tcp.crlf ||
                                  'Subject: ' || msg_subject ||
                                  utl_tcp.crlf || msg_text);
                                  dbms_output.put_line(' Finish Sending data');
                                  utl_smtp.quit(c);
              EXCEPTION
                   WHEN UTL_SMTP.INVALID_OPERATION THEN
    dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
                   WHEN UTL_SMTP.TRANSIENT_ERROR THEN
    dbms_output.put_line(' Temporary e-mail issue - try again');
    WHEN UTL_SMTP.PERMANENT_ERROR THEN
    dbms_output.put_line(' Permanent Error Encountered.');
    END;
    Procedure Created.
    SQL> execute prc_send_mail('[email protected]','[email protected]','Good Morning.');
    BEGIN prc_send_mail('[email protected]','[email protected]','Good Morning.'); END;
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 17
    ORA-06512: at "SYS.UTL_SMTP", line 96
    ORA-06512: at "SYS.UTL_SMTP", line 374
    ORA-06512: at "SCOTT.PRC_SEND_MAIL", line 19
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at line 1.
    Please tell me how to solve this problem.
    Thank You.

    1) Why did you install an SMTP server locally and then tell your code to try to use the server mail.google.com?
    2) The error you're getting is from mail.google.com indicating that Google isn't running an open SMTP server there. I would be very surprised if Google were running a publicly available SMTP server anywhere since that would be an invitation for spammers.
    Justin

  • Can't send e-mails to personal e-mail account outside the company

    Hello
    I'm trying to use UTL_SMTP package to send e-mails to users either by pressing a button, or deployed by a trigger. I'm using procedure Send_mail to do it but encountered a problem:
    if it's a company e-mail address, it works fine - although i haven't been able to put more than 2 recipients at the same time (ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address). if it's a personal account, it returns error ORA-29278: SMTP transient error: 421 Service not available.
    At this point, procedure's parameters are all static.
    I've tried using procedure Send of UTL_MAIL package but, having also static parameters, when sending to a personal account outside the company it also returns error ORA-29278.
    What am i doing wrong?
    Many thanks for your replies!

    I forgot to pass port 26 as a parameter in UTL_SMTP package.

  • To send the mail

    Hi,
    I have applied this in the 10g Oracle express database without any problem
    CREATE OR REPLACE PROCEDURE schema2.send_mail (
    p_mail_host IN VARCHAR2,
    p_from IN VARCHAR2,
    p_to IN VARCHAR2,
    p_subject IN VARCHAR2,
    p_message IN VARCHAR2)
    AS
    l_mail_conn UTL_SMTP.connection;
    BEGIN
    l_mail_conn := UTL_SMTP.open_connection(p_mail_host, 25);
    UTL_SMTP.helo(l_mail_conn, p_mail_host);
    UTL_SMTP.mail(l_mail_conn, p_from);
    UTL_SMTP.rcpt(l_mail_conn, p_to);
    UTL_SMTP.open_data(l_mail_conn);
    UTL_SMTP.write_data(l_mail_conn, 'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, 'From: ' || p_from || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, 'Subject: ' || p_subject || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, 'To: ' || p_to || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, '' || Chr(13));
    UTL_SMTP.write_data(l_mail_conn, p_message || Chr(13));
    UTL_SMTP.close_data(l_mail_conn);
    UTL_SMTP.quit(l_mail_conn);
    END send_mail;
    SHOW ERRORS
    Then I try to send one mail like this
    DECLARE
    vSender VARCHAR2(100) := 'postmaster@mysmtpdomain';
    vRecip VARCHAR2(30) := '[email protected]';
    vSubj VARCHAR2(50) := 'testing mail';
    vMesg VARCHAR2(4000) := 'I''m to check the smtp is working fine';
    vMType VARCHAR2(30) := 'text/plain; charset=us-ascii';
    BEGIN
    schema2.send_mail('mysmtpdomain', vSender, vRecip, vSubj, vMesg);
    END;
    but I can't receive the mail! Any advice?
    Best regards
    Edited by: HuaMin Chen on May 26, 2011 4:18 PM

    I still have got these (no improvements)
    17:31:48 SQL> create or replace procedure send_mail_nw
    17:31:54 2 IS
    17:31:54 3 mailhost VARCHAR2(30) := '10.?.5.?';
    17:31:54 4 mail_conn utl_smtp.connection;
    17:31:54 5 crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    17:31:54 6 mesg VARCHAR2( 1000 );
    17:31:54 7 BEGIN
    17:31:54 8 mail_conn := utl_smtp.open_connection('10.?.5.?', 25);
    17:31:54 9 mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
    17:31:54 10 'From: <postmaster@mysmtpdomain'||'>' || crlf ||
    17:31:54 11 'Subject: '||''testing mail' || crlf ||
    17:31:54 12 'To: '||'[email protected]'|| crlf ||
    17:31:54 13 '' || crlf || 'Testing mail procedure';
    17:31:54 14 utl_smtp.helo(mail_conn, '10.?.100.?');
    17:31:54 15 utl_smtp.mail(mail_conn, 'postmaster@mysmtpdomain');
    17:31:54 16 utl_smtp.rcpt(mail_conn, '[email protected]');
    17:31:54 17 utl_smtp.data(mail_conn, 'Testing mail procedure');
    17:31:54 18 utl_smtp.quit(mail_conn);
    17:31:54 19 END;
    17:31:54 20 /
    ERROR:
    ORA-24450: Cannot pre-process OCI statement
    17:31:54 SQL> show errors
    Errors for PROCEDURE SEND_MAIL_NW:
    LINE/COL ERROR
    10/10 PLS-00103: Encountered the symbol "POSTMASTER" when expecting one
    of the following:
    * & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    The symbol "*" was substituted for "POSTMASTER" to continue.
    10/45 PLS-00103: Encountered the symbol "||" when expecting one of the
    following:
    . ( * @ & = - + ; < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
    LIKE4_ LIKEC_ between || member SUBMULTISET_
    17:31:54 SQL>
    17:31:54 SQL> exec send_mail_nw
    BEGIN send_mail_nw; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00905: object SCHEMA2.SEND_MAIL_NW is invalid
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

  • Send e-mail sing trigger after insert

    Hi,
    I need to intiate a trigger in oracle dB after inserting a
    record to table I need to send a e-mail to specified person.
    This trigger should be cnditional.
    eg. Table emp
    columns: name dep sal
    on insert of every record to this table and when dep code is 3 I
    should send e-mail to named person.
    Please give me code examples.
    thanks

    Hi,
    Maybe what you are looking for is the db package UTL_SMTP?
    If you're using Forms, go to the Navigator, Database Objects,
    choose SYS schema and open Stored Program Units. If it's not
    there, contact your DBA. I'm not sure if it's available for
    databases prior to 8.1.6
    Hopefully, the package spec will have some examples that you can
    use.
    Good Luck,
    Pedro
    [email protected]

Maybe you are looking for

  • Can't find "help" in Acrobat 9.0 Pro

    Just installed Acrobat 9.0 Pro. when I click on the drop down menu for help and click 9.0 help, nothing happens. Even when I click "online support", nothing happens then. Can someone help me find "help"? Wisln

  • How can I create stop animation clip utilizing single images?

    Can I load individual images and overlap them to create a short animation clip? What is the best file type of still images to use, jpeg? How to overlap small image (with transparent background) on top of another background? Thank you!

  • Run DeploymentType NEWCOMPUTER logged in to existing Operating System.

    Hi, I've read quite a few articles but don't seem to be able to find the answer I'm looking for. Is it possible to run a NEWCOMPUTER deployment Scenario when the user is already logged into the old operating system / computer. So the service desk wil

  • Creating an applet instance

    Hi I am using Schulmberger Smart Card Tool Kit in order to create applet and applet instances. I have created the applet inside the card but I couldn't create an applet instance. Because when I am going to create the applet instance by using the soft

  • How to make a 'common' header?

    I am a very limited user of Dreamweaver. I have read other messages that mention using CSS for a common header or footer and other messages that talk of 'server side includes'. I have searched without success. Where do I find information that will he