Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

REXX - SMTP Issues

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: REXX - SMTP Issues
Reply with quote

This post is related to one of previous regarding Rexx Email sending program.
Reference : http://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: 8593
Location: Back in jolly old England

PostPosted: Wed Apr 10, 2013 5:46 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Apr 11, 2013 5:22 pm    Post subject: Reply to: REXX - SMTP Issues
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Apr 11, 2013 6:02 pm    Post subject: Reply to: REXX - SMTP Issues
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 12, 2013 11:07 am    Post subject: Reply to: REXX - SMTP Issues
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Fri Apr 12, 2013 12:14 pm    Post subject: Reply to: REXX - SMTP Issues
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 12, 2013 12:42 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 12, 2013 3:12 pm    Post subject: Reply to: REXX - SMTP Issues
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: 258

PostPosted: Fri Apr 12, 2013 10:11 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Sun Apr 14, 2013 11:18 pm    Post subject: Re: Reply to: REXX - SMTP Issues
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: 7913
Location: Bellevue, IA

PostPosted: Mon Apr 15, 2013 2:02 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us