Page 1 of 1

Sending emails to SMS(text) with CSSMTP via REXX

Posted: Wed May 25, 2016 2:14 am
by dkoppit
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                                                   

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

Posted: Wed May 25, 2016 2:20 am
by dkoppit
Did I miss something about posting with 'at' signs? My post doesn't show normal to me...

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

Posted: Wed May 25, 2016 4:38 am
by Robert Sample
Have you tested without REXX -- say, using IEBGENER to copy your email message?
Also, this line is suspicious to me:
[font=Courier New] EMAIL_ID = '##########@TXT.ATT.NET'  [/font]
 -- RCPT TO should be 10-digit-number@txt.att.net with <> around it and that is NOT what you have.

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

Posted: Wed May 25, 2016 9:34 am
by Anuj Dhawan
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.

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

Posted: Wed May 25, 2016 9:13 pm
by dkoppit
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.....

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

Posted: Wed May 25, 2016 10:23 pm
by Robert Sample
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.

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

Posted: Wed May 25, 2016 10:49 pm
by dkoppit
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.

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

Posted: Wed May 25, 2016 11:46 pm
by Robert Sample
Glad to hear you got it resolved.

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

Posted: Thu May 26, 2016 11:25 am
by Anuj Dhawan
Thanks for posting the final solution - it'll help someone in future, looking answer for similar question.

Appreciate your gesture, :)

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

Posted: Sat Aug 06, 2016 12:55 am
by Lbdyck
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/.