Good afternoon,
The question I have is a bit complex, but I do require your support.
I give a little context... I have a very large project in which I have to
“translate” REXX programs to python, and all executed via BATCH. As a first
program, I have to make one that, send some files via email. I already have the
whole program that does that, but I just need the SMTP sending part, but I have
no idea how to call the z/OS SMTP task or service with Python.
I understand that with the following structure, in REXX you can do it:
/* REXX */
LPAR = 'TEST LPAR '
SMTP.1 = 'HELO' MVSVAR('SYSNAME')
SMTP.2 = 'MAIL FROM:<[email protected]>'
SMTP.3 = 'RCPT TO:<[email protected]>'
SMTP.4 = 'DATA'
SMTP.5 = 'FROM:<[email protected]>'
SMTP.6 = 'TO:<[email protected]>'
SMTP.7 = 'SUBJECT:'LPAR'-DETAILS'
SMTP.8 = 'These are high priority alerts... '
"ALLOC F(SMTPOUT) SYSOUT(B) WRITER(SMTP)"
IF RC <> 0 THEN DO
SAY 'ERROR ALLOCATING SYSOUT FOR SMTP WRITER'
EXIT 12
END
"EXECIO * DISKW SMTPOUT (STEM SMTP. FINIS"
IF RC <> 0 THEN DO
So I ask for your support to know if there is a way to send an email through a
python program executed by BATCH and if you have any example, I would also
appreciate it very much.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN