avinash_k09

Cant the SEND_MAIL when attaching a log file

Discussion created by avinash_k09 on Dec 10, 2015
Latest reply on Feb 19, 2016 by Pete Wirfs
Hi,

Cant we use  SEND_MAIL twice in the same script.
I have a script in which under 2 code blocks I am using SEND_MAIL, but only the first SEND_MAIL is working, the other one is not working
In the mail I am attaching a file, a *.log file

So cant we use SEND_MAIL twice ??

!Picking the file
:PRINT &POS#
:IF &POSS# = 1
:SET &RET# = SEND_MAIL("avinash.krishnankutty@eversource.com",,&MESSAGE#,"File &FILE1# is available will be loaded. Thank you!")
:ELSE
:SET &RET# = SEND_MAIL("avinash.krishnankutty@eversource.com",,&MESSAGE1#,"File &FILE1# is not available.Please make sure its available. Thank you!")
:ENDIF
**************This is working 
!***************Error handling*******************
!Total logical records rejected:         0
:PRINT &RET4#
!:PRINT &LINE#
:SET &MESSAGE_log#="Error in loading"
:SET &MESSAGE1_log#="File successfully loaded"

!******** Send out the mail if errors are there ************
:IF &RET4# = 0
:SET &RET_log# = SEND_MAIL("avinash.krishnankutty@eversource.com",,&MESSAGE1_log#,"No error in loading",&FILE#)
:PRINT "no error"
:ELSE
:SET &RET_log# = SEND_MAIL("avinash.krishnankutty@eversource.com",,&MESSAGE_log#,"error in loading",&FILE#)
:PRINT "error"
:ENDIF
:ENDPROCESS
*****************************not working
!**************************************************************************

Thanks and Regards,
Avinash

Outcomes