View previous topic :: View next topic
|
Author |
Message |
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi,
I have trouble finding the name of the SMTP server address in our shop.
Is there any way to find out the SMTP address.?
For sending emails, we use IEBGENER and copy the below content to SMTP and this works fine.
Code: |
HELO TMVSK.TSL
MAIL FROM:<MAINFRAME@TO.COM>
RCPT TO:<VASANTH.SHANMUGAM@UK.TO.COM>
DATA
SUBJECT: ERROR !! YOUR ATTENTION IS REQUIRED...!!!!
TO: <VASANTH.SHANMUGAM@UK.TO.COM>
MIME-VERSION: 1.0;
Content-Type: Text;
hi how are u
.
QUIT |
Could you pls say, is TMVSK.TSL the SMTP address?
Now for the next part,
I assumed that TMVSK.TSL is the SMTP address and used it in below SAS program to send a email,
Code: |
//GLDSASAS EXEC SAS820,COND=(4,LT),OPTIONS='EMAILHOST=TMVSK.TSL'
//SAS.WORK DD DSN=&&SASWORK,DISP=(NEW,PASS),UNIT=TEMP,
// DCB=(LRECL=27648,BLKSIZE=27648,RECFM=FS),
// SPACE=(CYL,(8,10))
//CODE DD DSN=XK89.DREAM.CNTL,DISP=SHR
//SYSIN DD *
OPTIONS BUFNO=35 FULLSTIMER ;
%INCLUDE CODE(ATTACK);
/* |
But his comes up with the error as
Code: |
ERROR: Unable to connect to SMTP server.
ERROR: Unable to connect to SMTP server.
ERROR: Unable to connect to SMTP server.
ERROR: inet_addr failed, cannot convert address 'localhost'.
ERROR: inet_addr failed, cannot convert address 'localhost'.
ERROR: inet_addr failed, cannot convert address 'localhost'. |
Could you please suggest a technique to find the default SMTP address. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
No guarantee on this, but it might be worth a shot.
Look at your SMTP started task. Look at the OUTPUT DD. Look down for the message "EZA5645I IP Mailer Name : smtp.something..."
On my system, the value for the IP Mailer Name IS the domain name of our MS Exchange Server. SMTP is usually reserved to port 25. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
What do you get when you run without the EMAILHOST= option? The HELO name tends to be a red herring -- it can pretty much be anything you want and the email will go through, at least on z/OS systems. You need to look at the SMTP or TCPIP started task to get the actual IP address and name. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi,
Thanks for your time in this.
Superk,
I used only IEBGENER so cannot find EZA5645I in JES2 JOBLOG.
Any other techniques available?
Code: |
//XK89COPY JOB 1,'RESTARTS',CLASS=2,MSGCLASS=P,NOTIFY=XK89
//EMAIL01 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XK89.DREAM.CNTL(MAILTEXT),DISP=SHR
//SYSUT2 DD SYSOUT=(B,TCPSMTP)
//SYSIN DD * |
Robert,
I removed the EMAILHOST option, but the result is the same.
"Unable to connect"
and the HELO TMVSK.TSL seems to be some sort of address, cos I removed it and submitted the job, but I did not receive the mail.
Quote: |
You need to look at the SMTP or TCPIP started task to get the actual IP address and name. |
Could you please advice how to view the tasks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You should be able to use whatever package (SDSF, EJES, etc) is used at your site to look at job output; I can't tell you which to use since I don't know your site.
I just noticed you're running SAS 8.2; this is an older release of SAS and I haven't used it in several years. I do know the email component wasn't as good as SAS 9; you need to contact your site SAS support person and discuss your needs with that person. If set up correctly, the site support person probably shows up at the top of the SAS log for every SAS job run. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi Robert,
I tried the same program in SAS9.12
but unfortunately I get the same error.
I will try to make frens with the SYSPROGS and ask them. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Have you tried using ODS to output the email? The 9.1 ODS manual tells how to do this -- or if needed I believe I have an example of doing it that I can pull off my mainframe at some point. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi Robert,
Thanks again for your time in this.
yes I am using SAS ODS to send the Email.
I got the template from
www2.sas.com/proceedings/sugi29/039-29.pdf
Kindly post your example, I believe it will be helpful.
Thanks & Regards, |
|
Back to top |
|
|
rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
Hello Vasanthz,
Did you get the sol. using SAS...?? If so can you please share that with me.. I was also receiving the same error...
Code: |
inet_addr failed, cannot convert address 'MU001.MT1SMTP'
|
I have tried the below SAS options...
Code: |
OPTIONS='EMAILSYS=SMTP EMAILHOST=MU001.MT1SMTP'
|
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi,
I was unable to determine the solution as it was something to deal with the software installation setting and I think firewall.. Not sure.
But we have a work around for this ....
Just add an SMTP step below the report generation step.
Example:
Code: |
//GLDSASAS EXEC SAS,COND=(4,LT),OPTIONS='BUFNO=40,SVC11SCREEN'
//SAS.WORK DD DSN=&&SASWORK,DISP=(NEW,PASS),UNIT=TEMP,
// DCB=(LRECL=27648,BLKSIZE=27648,RECFM=FS),
// SPACE=(CYL,(8,10))
//CODE DD DSN=XK89.BORED.PROGRAMR,DISP=SHR
//SYSIN DD *
OPTIONS BUFNO=35 FULLSTIMER ;
%INCLUDE CODE(SEETHIS);
/*
//MAILSTEP EXEC PGM=IEBGENER,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XK89.SUPER.HEADER4,DISP=SHR
// DD DSN=XK89.HT,DISP=SHR
//SYSUT2 DD SYSOUT=(B,TCPSMTP)
//SYSIN DD *
/* |
The GLDSASAS step generates the report using ODS and outputs in watever format u like RTF or HTML into xk89.HT.
The MAILSTEP then sends this report.
The contents of XK89.SUPER.HEADER4 is
Code: |
HELO TMVSC.TSL
MAIL FROM:<MAINFRAME@XXXXX.COM>
RCPT TO: <VASANTH.SHANMUGAM@UK.XXXXX.COM>
DATA
FROM: MAINFRAME
TO: UNDISCLOSED
SUBJECT: EOD TIMINGS OF ALL DEPOTS
MIME-VERSION: 1.0;
CONTENT-TYPE: TEXT/RICH TEXT;
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TIMINGS.DOC |
tontodain we have an ods report sent to email. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi,
On the other hand I think the address u have given is incorrect. Since it was unable to resolve the IP of the address u provided.
Example,
If we communicate with any server, its IP will be automatically resolved,
like this (PC ping using CMD) automatically.
|
|
Back to top |
|
|
rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
Well, The SMTP server which I was using in SAS options is used in sending E-Mails using the program IKJEFT01. It's working fine in PROD. When I tried the same SMTP server using SAS pgm, it failed...
Is there any command that lists the available SMTP servers that are availble in the mainframe...?? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You may have to contact your site support group for help. The name is from the TCP/IP parameter file that is pointed to by DD name SYSTCPD in the TCP/IP job. There will be a HOSTNAME field and DOMAINORIGIN field. <hostname>.<domainorigin> is the desired server name -- at least it works on my system. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Yep, same here. A SYSTCPD DD statement has to be included in the JCL. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Hi,
After 8 months, finally there is a solution for this
The trouble was finding the SMTP server address.
Similar to what Robert has mentioned,
Quote: |
SYSTCPD in the TCP/IP job |
The server address was located in a job called TCPSMTP at our shop.
The job has DD name as //CONFIG & inside the //config DSN there is a IP address something like MAILER 128.2.*.**.
So this is the SMTP address
Code: |
//BORED EXEC SAS,OPTIONS='EMAILHOST=128.*.*.**'
//SAS.WORK DD DSN=&&SASWORK,DISP=(NEW,PASS),UNIT=TEMP,
// DCB=(LRECL=27648,BLKSIZE=27648,RECFM=FS),
// SPACE=(CYL,(8,1))
//SYSIN DD *
FILENAME SEND EMAIL
FROM = 'VASANTH@T***.COM'
TO = 'VASANTH.SHANMUGAM@UK.T****.COM'
SUBJECT = 'CHARGES REPORT'
ATTACH = ('XK89.BORED.PROGRAMR(T***)' EXT='JPG');
DATA _NULL_;
FILE SEND;
PUT 'PLEASE RECEIVE THE ATTACHED REPORT.';
RUN;
/* |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Vasanth,
Thank you for the followup
d |
|
Back to top |
|
|
|