AS400 : Add a new line in text in email SNDSMTPEMM

Declare 
** NAMED CONSTANTS FOR CARRIAGE RETURN  Which will move the control to next line                     
D CR              C                   CONST(X'0D')                  //0->Zero


D vSepj           S              1    Inz('/')  
D vQot            S              1    INZ('''') 

DRunCommand       PR                  extpgm('QCMDEXC')               
D pCommand                    2560    const                           
D pCmdLength                    15  5 const                           
D pCommand        S           2560                                    
D pCmdLength      S             15  5 inz(2560)                       


pComdse  = 'SNDSMTPEMM RCP(' + %Trim(vpToAdr) + %Trim(vpCcAdr) +
                      %Trim(vpBccAdr)  + ') SUBJECT(' +                    
                       %Trim(vpSubject) + ')';       

vpContent = ‘TEST’;                     
vpContent = %Trim(vpContent) + Cr + '**Error adding ' +      
                     %Trim(FileNm) + ' to attachment. ' +              
                     %trim(Sds_JobName)+ vsepj+%Trim(Sds_JobUser)+       
                     vSepj+Sds_Jobnumber;                                 

vpContent = vQot+%Trim(vpContent)+vQot;                
pComdse = %trim(pComdse) + ' NOTE(' + %Trim(vpContent) +
                    ') ATTACH(' + %Trim(FileNmc) +')';            

Runcommand(pComdse:pCmdLength);





For SNDDST in :/N will cause carriage return

Comments

Popular posts from this blog

AS400 Display: Radio Button (SNGCHCFLD)

AS400 Display File: Check Box (MLTCHCFLD)