How to fetch the User's Email Id in AS400?

820 Views Asked by At

I need to send a mail to the user that the job which is submitted has ended in error, for this how should i retrieve/fetch the email id of the user?

1

There are 1 best solutions below

0
Scott Mildenberger On BEST ANSWER

If you have defined the users email in the System Distribution Directory then you can retrieve the email with this RPG code:

chain User_Name qaokl02a;                                  
if %found;                                                 
  chain (wos1dden : machine) qatmsmtpa;                    
  if %found;                                               
    domroute = %xlate(up : lo : domroute);                 
    emailaddress = %trim(smtpuid) + '@' + %trim(domroute); 
  endif;
endif;