Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send an email with attachment

Status
Not open for further replies.

daryani

Programmer
Aug 28, 2003
5
How do I send an email with attachment in REXX
 
If you working in a mainframe environment and want to transmit a file as an attachment, you could use the below job;

Code:
//STEP1    EXEC PGM=IEBGENER 
//* 
//SYSIN    DD DUMMY 
//SYSPRINT DD SYSOUT=* 
//SYSUDUMP DD SYSOUT=* 
//SYSUT2   DD SYSOUT=(M,SMTP) 
//SYSUT1   DD * 
HELO SYSA 
MAIL FROM:<PRAKAL@HOTMAIL.COM> 
RCPT TO:<DARYANI@HOTMAIL.COM> 
DATA 
FROM:      <KOLUSU@HOTMAIL.COM> 
TO:         VIKRAM@HOTMAIL.COM 
SUBJECT: file 
MIME-VERSION: 1.0 
CONTENT-TYPE: MULTIPART/MIXED;              
BOUNDARY=  &quot;DELIMITER&quot; 
THIS MESSAGE IS IN MIME FORMAT 
--DELIMITER
Content-Disposition:attachment;filename=&quot;ATTACH FILE.txt&quot; 
CONTENT-TYPE: TEXT/HTML 
<PRE> <FONT FACE=&quot;ARIAL&quot; SIZE=1> 
//          DD DISP=SHR,DSN=YOUR.PDS(MEMBER) 
// DD * 
--DELIMITER
. 
quit 
//

For this you would need SMTP started task running on your mainframe.

Prakal
 
You can put the smtp parameter inside de rexx program, see below.


QUEUE to
QUEUE ' '
QUEUE ' '
QUEUE insert text
QUEUE Subject
QUEUE ' '
QUEUE &quot;&quot;
QUEUE 'END SAVE'
QUEUE 'SEND'
address &quot;TSO&quot;
&quot;exec 'SMTP library(smtp)'&quot;


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top