I’ve never sent email this way,,, but I do believe the SMTP commands should be under the SYSUT1 DD statement not SYSIN. The SYSIN DD statement should be a DUMMY. Take a look at this webpage:
Also,,, you may want ot look at the TSO command SMTPNOTE. I’ve used it in REXX exec’s and it works very nicely.