MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To transfer file as an attachment thru rexx program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sricons123
Beginner


Joined: 04 Oct 2004
Posts: 21
Topics: 11

PostPosted: Sun Oct 10, 2004 7:30 am    Post subject: To transfer file as an attachment thru rexx program Reply with quote

Hi
How to send the file as an mail attachment thru rexx program. i searched in the postings, but i got for XMIT. I want this in the rexx. Can anybody pl s let me know this.

Thanks
Sricons
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Oct 11, 2004 5:32 am    Post subject: Reply with quote

sricons123,

As far as I know REXX by itself does not the ability of transmitting. However you can invoke a XMIT from your rexx program? Is that what you want?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sricons123
Beginner


Joined: 04 Oct 2004
Posts: 21
Topics: 11

PostPosted: Mon Oct 11, 2004 7:40 am    Post subject: Reply with quote

Hi kolusu
Its like that only by using rexx.


Sricons
Back to top
View user's profile Send private message AIM Address
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Oct 11, 2004 7:46 am    Post subject: Reply with quote

This is a test program that I use. You can modify it as needed:

Code:

/* REXX */

smtp_server      = 'my.smtp.server.address.com'
smtp_from        = 'superk@my.address.com'
smtp_address     = 'superk@my.address.com'
smtp_to          = 'superk@my.address.com'
smtp_replyto     = 'superk@my.address.com'
crlf = x2c('0d25')

str = Socket('initialize', Date(B))
Parse Var str sockrc subtaskid maxdesc tcpipuser

str = Socket('Socket', 'af_inet', 'stream', 'tcp')
Parse Var str sockrc sockid

str = Socket('SetSockOpt', sockid, 'sol_socket', 'SO_ASCII', 'on')

server_info = 'AF_INET 25 ' || smtp_server
str = Socket('Connect', sockid, server_info)

str = Socket('Recv', sockid, 10000)
Parse Var str sockrc data_length smtp_response

msg= 'HELO ' || smtp_server || crlf
str = Socket('Send', sockid, msg)
Parse Var str sockrc data_length smtp_response

str = Socket('Recv', sockid, 10000)
Parse Var str sockrc data_length smtp_response

msg= 'MAIL FROM:<' || smtp_from || '>' || crlf
str = Socket('Send', sockid, msg)

str = Socket('Recv', sockid, 10000)
Parse Var str sockrc data_length smtp_response

msg= 'RCPT TO:<' || smtp_address || '>' || crlf
str = Socket('Send', sockid, msg)

str = Socket('Recv', sockid, 10000)
Parse Var str sockrc data_length smtp_response

msg= 'DATA' || crlf
str = Socket('Send', sockid, msg)

str = Socket('Recv', sockid, 10000)
Parse Var str sockrc data_length smtp_response

the_subject = 'This is a Test'

msg = 'To:' smtp_to || crlf ,
   || 'Reply-To:' smtp_replyto || crlf ,
   || 'Subject:' the_subject || crlf ,
   || 'X-Mailer: REXX Exec on MVS' || crlf
str = Socket('Send', sockid, msg)

msg = 'Mime-Version: 1.0' || crlf
str = Socket('Send', sockid, msg)

msg = 'Content-type: multipart/mixed;' ,
      'boundary="Mime.Part.0x0zlrhg"' || crlf
str = Socket('Send', sockid, msg)

msg = 'This is a multi-part message in MIME format.' || crlf
str = Socket('Send', sockid, msg)

msg = '--Mime.Part.0x0zlrhg' || crlf
str = Socket('Send', sockid, msg)

msg = 'Content-Type: text/plain; charset="iso-8859-1"' || crlf
str = Socket('Send', sockid, msg)

msg = 'Content-Transfer-Encoding: 7bit' || crlf
str = Socket('Send', sockid, msg)

msg = '* ---------------------------- *' || crlf
str = Socket('Send', sockid, msg)

msg = '* ---------------------------- *' || crlf
str = Socket('Send', sockid, msg)

msg = '* ---------------------------- *' || crlf
str = Socket('Send', sockid, msg)

msg = '--Mime.Part.0x0zlrhg' || crlf
str = Socket('Send', sockid, msg)

msg = 'Content-Type: text/plain;',
      'name=report.txt' || crlf
str = Socket('Send', sockid, msg)

msg = 'Content-Transfer-Encoding: 7bit' || crlf
str = Socket('Send', sockid, msg)

msg = 'Content-Disposition: attachment;',
      'filename=report.txt' || crlf
str = Socket('Send', sockid, msg)

msg = 'Content-Description: report.txt' || crlf
str = Socket('Send', sockid, msg)

msg = crlf
str = Socket('Send', sockid, msg)

msg = ''
Do loop = 1 To 100
  msg = msg || 'This is a test record' loop 'of 100' || crlf
End
str = Socket('Send', sockid, msg)

str = Socket('Send', sockid, crlf)

msg = crlf || '.' || crlf
str = Socket('Send', sockid, msg)

str = Socket('Recv', sockid, 10000)
Parse Var str sockrc data_length smtp_response

msg= 'QUIT' || crlf
str = Socket('Send', sockid, msg)

str = socket('Close', sockid)
str = socket('Terminate', subtaskid)
Say 'Email sent to ' smtp_to

Exit
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group