IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX - SMTP Issues


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
swathykrishnan

New User


Joined: 01 Oct 2010
Posts: 43
Location: Bangalore

PostPosted: Wed Apr 10, 2013 5:09 pm
Reply with quote

This post is related to one of previous regarding Rexx Email sending program.
Reference : ibmmainframes.com/viewtopic.php?t=12103&highlight=send+email

While executing the code I am getting the following error message
Code:
       >F>   "0 460 500 5.5.1 Command unrecognized: "To:swathy_krishnan
Ümycomp.de "??500 5.5.1 Command unrecognized: " Reply-To: swathy_krishn
anÜmycomp.de "??500 5.5.1 Command unrecognized: " Subject: This is a Test #1 "
??500 5.5.1 Command unrecognized: " X-Mailer: REXX Exec on ZOS "??500 5.5.1 Com



Could you please help me resolve the issue.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 10, 2013 5:46 pm
Reply with quote

With the amount of information you have given there is little chance of getting help.
Back to top
View user's profile Send private message
swathykrishnan

New User


Joined: 01 Oct 2010
Posts: 43
Location: Bangalore

PostPosted: Thu Apr 11, 2013 4:55 pm
Reply with quote

I think we can consider this post as a continuation of the post which i have mentioned in the post.
Quote:
next time please start a new topic rather than piggybacking on a year old thread


I have seen this comment by enrico there and started it as a new post.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 11, 2013 5:22 pm
Reply with quote

We need to know the code. If it is the code from the original topic, you need to say so.
Back to top
View user's profile Send private message
swathykrishnan

New User


Joined: 01 Oct 2010
Posts: 43
Location: Bangalore

PostPosted: Thu Apr 11, 2013 5:44 pm
Reply with quote

Please find the source code below


Code:
/*rexx*/                                                         
trace i                                                                                                         
address tso                                                       
smtp_server      = 'USER1.MAIL'                       
smtp_from        = 'swathy@XXX.de'           
smtp_address     = 'e'swathy@XXX.de'             
smtp_to          = 'swathy@XXX.de'           
smtp_replyto     = 'swathy@XXX.de'         
crlf = X2C('0d25')                                               
/* SMTP Initialization */                                         
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)               
str = Socket('Recv', sockid, 10000)             
/* Mail Message */                             
msg = 'MAIL FROM:<'smtp_from'>'Crlf             
str = Socket('Send', sockid, msg)               
str = Socket('Recv', sockid, 10000)             
msg= 'RCPT TO:<'smtp_address'>'crlf             
str = Socket('Send', sockid, msg)               
str = Socket('Recv', sockid, 10000)             
msg= 'DATA'crlf                                 
str = Socket('Send', sockid, msg)               
str = Socket('Recv', sockid, 10000)             
the_subject = 'This is a Test #1'               
msg = 'To:' smtp_to crlf ,                     
      'Reply-To:' smtp_replyto crlf ,           
      'Subject:' the_subject crlf ,           
      'X-Mailer: REXX Exec on ZOS' crlf       
  str = Socket('Send', sockid, msg)           
  str = Socket('Send', sockid, crlf)           
  msg = 'Test mail from 'Userid()crlf
  str = Socket('Send', sockid, msg)           
  msg = crlf'.'crlf                           
  str = Socket('Send', sockid, msg)           
  str = Socket('Recv', sockid, 10000)         
  /* End of Mail Message */                                       
  msg= 'QUIT'crlf                             
  str = Socket('Send', sockid, msg)           
  str = socket('Close', sockid)               
  str = socket('Terminate', subtaskid)         
  Say 'mail send to ' smtp_to                 
  exit;                                       
                 
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 11, 2013 6:02 pm
Reply with quote

read the REXX manuals about concatenation and continuation lines
and read the original script which worked and compare it to the one You posted

do not change things if You do not understand/know what You are doing
Back to top
View user's profile Send private message
swathykrishnan

New User


Joined: 01 Oct 2010
Posts: 43
Location: Bangalore

PostPosted: Fri Apr 12, 2013 10:35 am
Reply with quote

Hello Enrico

I couldn't see any difference between writing

name = 'SASI'
strng = 'HELLO'name

and
strng ='HELLO'!!name.

Also abuttal symbol is giving the following error message for me

Code:
msg= 'HELO '||smtp_server || crlf

Result
Code:
     24 +++  msg= 'HELO '|                                         
     13 +++ crlf = X2C('0d25')                                     
 IRX0013I Error running TEST, line 24: Invalid character in program
 ***                                                               
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 12, 2013 11:07 am
Reply with quote

As far as i know a "crlf" is :

Code:
crlf = X2C('0d0a')


in stead of :

Code:
crlf = X2C('0d25')
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 12, 2013 12:14 pm
Reply with quote

In both EBCDIC and ASCII, X'0D' is CR, but LF is X'25' in EBCDIC and X'0A' in ASCII.

X'0D25' is CR/LF after it has been converted from ASCII.
Back to top
View user's profile Send private message
swathykrishnan

New User


Joined: 01 Oct 2010
Posts: 43
Location: Bangalore

PostPosted: Fri Apr 12, 2013 12:23 pm
Reply with quote

I have tried both but still I am getting same error message.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Apr 12, 2013 12:42 pm
Reply with quote

You appear to have unbalanced quotes in one line of your code
Code:
smtp_address     = 'e'swathy@XXX.de'


Also looking at the error messages, the @ sign appears to be missing from the email addresses / references

I'm sure that in the past I have encountered a translation problem where the valid abbutal character was ! (exclamation mark) instead of | (pipe)
Back to top
View user's profile Send private message
swathykrishnan

New User


Joined: 01 Oct 2010
Posts: 43
Location: Bangalore

PostPosted: Fri Apr 12, 2013 3:08 pm
Reply with quote

.
Quote:
You appear to have unbalanced quotes in one line of your code
Code:
smtp_address = 'e'swathy@XXX.de'


the error occured while editing the code to post here. In source code it is proper.
Quote:
Also looking at the error messages, the @ sign appears to be missing from the email addresses / references

Yes, I have noticed the same.swathy_krishnan@mycomp.de has become swathy_krishnanÜmycomp.de in the error message. any thoughts on this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 12, 2013 3:12 pm
Reply with quote

check the code page used for Your 3270 emulation.
Back to top
View user's profile Send private message
nevilh

Active User


Joined: 01 Sep 2006
Posts: 262

PostPosted: Fri Apr 12, 2013 10:11 pm
Reply with quote

I agree with Enrico... from
Quote:
smtp_from = 'swathy@XXX.de'
and
Quote:
swathy_krishnanÜmycomp.de
it looks suspiciously like the op is working on a "German" based machine . If this is the case he will have to use the appropriate characters.eg
Quote:
||
does not exist on a German system you would have to use
Quote:
!!
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Apr 14, 2013 11:18 pm
Reply with quote

Bill Woodger wrote:
In both EBCDIC and ASCII, X'0D' is CR, but LF is X'25' in EBCDIC and X'0A' in ASCII.

X'0D25' is CR/LF after it has been converted from ASCII.


Sure Bill, thats when you use IBM SMTP as receiver of the commands, here we are talking rexx sockets. I did see some rexx sockets execs, but crlf's were never used.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Apr 15, 2013 2:02 am
Reply with quote

EBCDIC has a CR character at X'25' but an ASCII CR is frequently translated as NL (X'15') instead of X'25'.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top