Sending emails to SMS(text) with CSSMTP via REXX

Time Sharing Option, Interactive System Productivity Facility and REstructured eXtended eXecutor

Moderator: mickeydusaor


Topic author
dkoppit
New Member
Posts: 5
Joined: Wed May 25, 2016 12:09 am
Been thanked: 1 time

Sending emails to SMS(text) with CSSMTP via REXX

Postby dkoppit » Wed May 25, 2016 2:14 am

Below is a sample of the REXX code that I always use to send email alerts with my automation product.   I normally send to yourname@domain.com, and its always works fine.   Now I wish to send an email directly to SMS text via the Cell Providers SMS email addresses i.e. ##########@txt.att.net.    In my testing, I can never get the SMS text to go through.   It also fails when I tested with a coworkers SMS email address.   I tested sending myself an SMS text email via Gmail and Lotus Notes and it works fine.  
We have z/OS 2.1 and CSSMTP.   Any thoughts on where else I can look?   I changed the code page from IBM-1047 to 037, but that didn't do anything.

Email REXX

Code: Select all

 EMAIL_ID = [email='##########@TXT.ATT.NET']'##########@TXT.ATT.NET'[/email]       
WVAR.1 ="HELO STLMVS01"                    
WVAR.2 ="MAIL FROM:<[email="OPID()"@"CURSYS]"OPID()"@"CURSYS[/email]()">"  
WVAR.3 ="RCPT TO:<"EMAIL_ID">"             
WVAR.4 ="DATA"                             
WVAR.5 ="DATE:    "DATE('N')"  "TIME()" LCL"
WVAR.6 ="FROM:    "CURSYS()                
WVAR.7 ="TO: " EMAIL_ID                    
WVAR.8="SUBJECT: TEST TEXT EMAIL ALERT"    
                                           
WVAR.0=8                                   
                                           
'PIPE LIT /./ | STEM WVAR. APPEND'         
'PIPE LIT /QUIT/ | STEM WVAR. APPEND'      
'PIPE STEM WVAR. | SAFE SMTPSAFE'          
'SENDMAIL SMTPSAFE RTRNSAFE'               


SENDMAIL Rexx

Code: Select all

SMTP_JOB = 'SMTPSERV'                                           
                                                                
PARSE ARG SMTP_CMD_SAFE RETURN_SAFE                             
                                                                
'PIPE NETV ALLOCATE SYSOUT(B) WRITER('SMTP_JOB') FREE RECFM(FB)',
                    'LRECL(80) BLKSIZE(4000) FREE',             
           '| VAR MESSAGE'                                      
                                                                
PARSE VAR MESSAGE MSGID DDNAME .                                
IF MSGID='CNM272I'                                              
   THEN                                                         
       DO                                                       
          'PIPE SAFE 'SMTP_CMD_SAFE' | QSAM (DD) 'DDNAME        
          'PIPE LIT /EMAIL SENT SUCCESSFULLY/ | SAFE 'RETURN_SAFE
          EXIT 0                                                 
      END                                                   




Topic author
dkoppit
New Member
Posts: 5
Joined: Wed May 25, 2016 12:09 am
Been thanked: 1 time

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby dkoppit » Wed May 25, 2016 2:20 am

Did I miss something about posting with 'at' signs? My post doesn't show normal to me...



Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby Robert Sample » Wed May 25, 2016 4:38 am

Have you tested without REXX -- say, using IEBGENER to copy your email message?
Also, this line is suspicious to me:
 EMAIL_ID = '##########@TXT.ATT.NET'  
 -- RCPT TO should be 10-digit-number@txt.att.net with <> around it and that is NOT what you have.



User avatar

Anuj Dhawan
Founder
Posts: 2392
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Has thanked: 152 times
Been thanked: 66 times

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby Anuj Dhawan » Wed May 25, 2016 9:34 am

dkoppit wrote:Did I miss something about posting with 'at' signs?    My post doesn't show normal to me...


Please check your PM.

There is suggestion from ATT - ATT’s official suggested method can be looked at here: http://www.att.com/esupport/article.jsp ... 037&cv=820

As other email clients of yours seems to work as anticipated, suggest that you talk to ATT and get tech support, if your phone is not receiving the message.


Thanks,
Anuj


Topic author
dkoppit
New Member
Posts: 5
Joined: Wed May 25, 2016 12:09 am
Been thanked: 1 time

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby dkoppit » Wed May 25, 2016 9:13 pm

Sorry if I didn't make it clear before, but SMS text emails are working to my phone from Lotus Notes and Gmail, so its not an ATT issue. Also, my RCPT TO field adds the "< >" brackets after my variable is set.

Additionally, I did set up an IEBGENER job and successfully sent an email to my SMS text email from there. Perhaps the REXX is changing a format somehow, but the successful message looks identical to the one that was not successful in the CSSMTP log.....



Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby Robert Sample » Wed May 25, 2016 10:23 pm

It sounds like time to get your site support group involved.  They may need to trace the message over the network until it leaves your site's network to validate that nothing is being done to the message.  If it works for IEBGENER, it should work from REXX -- so if it isn't, there's something site-specific happening to the REXX message.




Topic author
dkoppit
New Member
Posts: 5
Joined: Wed May 25, 2016 12:09 am
Been thanked: 1 time

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby dkoppit » Wed May 25, 2016 10:49 pm

Yes, turns out you were correct Robert. I changed the "MAIL FROM" field to a valid email address, and the REXX sent fine. We apparently have some internal firewall/smtp rules that don't allow emails from invalid addresses to leave the company. In my case, my REXX variables created a fake email of "myuserid"@"mylparname", which was of course invalid.

Thanks for your assistance in this.



Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby Robert Sample » Wed May 25, 2016 11:46 pm

Glad to hear you got it resolved.



User avatar

Anuj Dhawan
Founder
Posts: 2392
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Has thanked: 152 times
Been thanked: 66 times

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby Anuj Dhawan » Thu May 26, 2016 11:25 am

Thanks for posting the final solution - it'll help someone in future, looking answer for similar question.

Appreciate your gesture, :)


Thanks,
Anuj


Lbdyck
Registered Member
Posts: 12
Joined: Wed Feb 10, 2016 8:42 pm
Been thanked: 7 times

Re: Sending emails to SMS(text) with CSSMTP via REXX

Postby Lbdyck » Sat Aug 06, 2016 12:55 am

For a generalized solution to sending e-mail from z/OS check out XMITIP from www.lbdsoftware.com. This utility is in use at several hundred sites around the world and makes it easy to send plain text emails, or get complex with attachments. Included with the tool are routines to convert text to html, rtf, and csv and there is another download, TXT2PDF, that wll convert files to PDF format.

The e-mails can be sent to an SMS (text message) device but you probably don't want to include attachments. To send to a SMS address check out the different cell providers for their e-mail address format. Here is a url with some more information http://www.digitaltrends.com/mobile/how ... -sms-text/.




Return to “TSO, ISPF & REXX (Do you still do CLIST?!).”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests