How to send Mail thru Oracle Host Program




How to send mail thru HOST program

To run a unix based shell script as a concurrent program, the executable of the concurrent program should be registered as a ‘Host’ program.

The execution file name of the host program should end with .prog extension and a soft link should be created for the .prog file.

Here is an example of creation of host program with one parameter:
Step 1:
Create a prog file XX_HOST_PROGRAM.prog as shown below
###############################################################################
#  Copyright (c) Oracle Shooter.     All rights reserved.
###############################################################################
###############################################################################
# Application       : XXSD                                                    #
# Program Name      : XX Host Program                                         #
# Version #         : 1.0                                                     #
# Title             : XX_HOST_PROGRAM                                         #
# Remarks           : Shell Script                                            #
# Created by        : Oracle shooter                                          #
# Creation Date     : 25-May-2020                                             #
#                                                                             #
# Description       : Use Shell script for Sending Mail or Message                     #
#                                                                             #
#=============================================================================#
# Date        | Name             | Remarks                                    #
#=============================================================================#
# 25-05-2020  | MANOJ KUMAR      | Initial Draft                              #
###############################################################################
#                 These 5 are system Defines Parameters                       #
###############################################################################
 
V_SUBJECT0=${0}
V_SUBJECT1=${1}
V_SUBJECT2=${2}
V_SUBJECT3=${3}
V_SUBJECT4=${4}
 
echo "***********************************************************"
echo "                   SYSTEM PARAMETERS  Details              "
echo "***********************************************************"
echo "  "
echo "Parameter 0 :- Shell script name along with Path       : " $V_SUBJECT0
#echo "Parameter 1 :- Oracle Apps User Name and Password : " $V_SUBJECT1
echo "Parameter 2 :- Application user_id from FND_USER       : " $V_SUBJECT2
echo "Parameter 3 :- Application user_name from FND_USER  : " $V_SUBJECT3
echo "Parameter 4 :- Concurrent Program Request ID       : " $V_SUBJECT4
 
###############################################################################
#          Defined Parameters and assign values in other variables            #
#          Concurrent Program Parameter start from 5                          #
###############################################################################
 
V_FROM=${5}
V_TO=${6}
V_CC=${7}
V_BCC=${8}
V_SUB=${9}
V_BODY=${10}
 
echo "***********************************************************"
echo "                   INPUT PARAMETERS  Details               "
echo "***********************************************************"
echo "  "
echo "Parameter 5  :- FROM : "  $V_FROM
echo "Parameter 6  :- TO : "  $V_TO
echo "Parameter 7  :- CC : "  $V_CC
echo "Parameter 8  :- BCC : "  $V_BCC
echo "Parameter 8  :- SUB : "  $V_SUB
echo "Parameter 8  :- BODY : "  $V_BODY
echo "  "
 
echo "$V_BODY" | /bin/mailx -s "$V_SUB"  -r "$V_FROM" -c "$V_CC"  -b "$V_BCC"  "$V_TO"
 
if [ $? -eq 0 ]
then
echo "!!!!!! Email was sent to :-  $V_TO"
else
echo "!!!!!!  Email Could not send SORRY !!!!!!!!"
exit 1
fi

Step 2:

Upload the .prog file to the bin folder of rexspective application top and give necessary file permissions







Step 3: Go to respective location :-

/u01/appluat/UAT/apps/apps_st/appl/xxsd/12.0.0/bin




Create Soft Link:- Then run this script for creating the soft link

ln -s $FND_TOP/bin/fndcpesr  XX_HOST_PROGRAM
Soft link will be created against fndcpesr so that concurrent manager will recoganize as host program.


Step 4:

Create Executable and Concurrent Program





OUTPUT:-
***********************************************************
                   SYSTEM PARAMETERS  Details             
***********************************************************
 
Parameter 0 :- Shell script name along with Path     :  /u01/appluat/UAT/apps/apps_st/appl/xxsd/12.0.0/bin/XX_HOST_PROGRAM.prog
Parameter 2 :- Application user_id from FND_USER     :  0
Parameter 3 :- Application user_name from FND_USER  :  SYSADMIN
Parameter 4 :- Concurrent Program Request ID      :  1539961070
***********************************************************
                   INPUT PARAMETERS  Details              
***********************************************************
 
Parameter 5  :- FROM :  ERPAlert.com
Parameter 6  :- TO :  Oracle.shooter@gmail.com
Parameter 7  :- CC :
Parameter 8  :- BCC :
Parameter 8  :- SUB :  Host Program Tesing
Parameter 8  :- BODY :  Hi Friends, Please find the messgae.
 
!!!!!! Email was sent to :-  Oracle.shooter@gmail.com



Comments

  1. Please make video for Mailer program also in which we would convert SQL records to Excel in PLSQL. Also we would be doing compress and zip activities

    ReplyDelete

Post a Comment

Popular posts from this blog

E-Text Report In Fusion | Types of E-Text reports

Supplier API's

How to pass default Parameter in cursor