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

sending emails from JCL


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Mon Mar 15, 2010 2:39 pm
Reply with quote

Hello

I'm trying to send email:

HELO mvshost
MAIL FROM: <James@xyz.COM>
RCPT TO: <john06@xyzcom>
DATA
FROM: James@xyz.COM
TO: john06@xyzcom
SUBJECT:HI

but getting mail delivery failure email with below msg

Unable to deliver mail to some/all recipients.
050 FROM: James@xyz.com
500 Unknown command, 'FROM'
050 TO: john06@xyz.com
500 Unknown command, 'TO'
050 SUBJECT:HI
500 Unknown command, 'SUBJECT'
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Mar 15, 2010 2:53 pm
Reply with quote

Please search the Forum on "SMTP" and author as "Robert Sample" or "superk".
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 Mar 15, 2010 4:51 pm
Reply with quote

Right off the bat, I can state that if you have posted exactly what you're using for the email, it is not correctly formed per RFC 2821 and therefore will never be sent. The RCPT TO must be <mailbox@domain> where domain is a dot-separated field. Without the dot, the email recipient is invalid and therefore the entire email is invalid.

Furthermore, if you want assistance why are you not posting the responses from the HELO forward? They can be significant.
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Mon Mar 15, 2010 8:03 pm
Reply with quote

hi
Have a look on the attachment that i posted before.
The RCPT field , i was using the correct address, but did a writing mistake before.

i am still getting the same error.

HELO PLIPC3E
MAIL FROM: <James@xyz.COM>
RCPT TO: <john06@xyz.com>
DATA
FROM: James@xyz.COM
TO: john06@xyz.com
SUBJECT:HI

ERROR that i am getting to my mail box is

Unable to deliver mail to some/all recipients.
050 DATA hi
501 Syntax Error. No Args after 'DATA' command
050 FROM: <James@xyz.COM>
500 Unknown command, 'FROM'
050 TO: <john06@xyz.com>
500 Unknown command, 'TO'
050 SUBJECT:eec record missing
500 Unknown command, 'SUBJECT'

** Text of Mail follows **
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 15, 2010 8:18 pm
Reply with quote

You need to look for data in your input data stream that's not supposed to be there (do you have NUM ON enabled, for example).
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 Mar 15, 2010 8:20 pm
Reply with quote

1. You have line numbers in your file. Line numbers are mainframe-specific and are not recognized by SMTP. Turn them off and delete everything in columns 73 through 80 of your input file.

2. DATA must be on a line by itself -- nothing else on the line. The output you are showing does not match the input you posted, as it shows DATA hi 00031014 -- the hi would be invalid, just as the 00031014 line number is invalid.
Back to top
View user's profile Send private message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 85
Location: bangalore

PostPosted: Tue Mar 16, 2010 2:55 pm
Reply with quote

thankx . now its working.....

now one more thing , i want to send a file through attachment
i am using the below code , which is posted before ..

JOB HREJ40XX COMPLETED(SEE ATTACHMENT)
WORK UNIT REC W/O CLAIM REC
MIME-VERSION:1.0
CONTENT-TYPE:TEXT/PLAIN
CONTENT-DISPOSITION:ATTACHMENT;FILENAME=FILE.TXT
// DD DSN=TDSCM.TIAJ567.SYSIN(EECMISNG),DISP=SHR
// DD DSN=TDSCM.TIAJ567.SYSIN(PERIOD),DISP=SHR
//

here i am getting all the things as a mail content. no attachment.
can u give some idea...
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Tue Mar 16, 2010 4:28 pm
Reply with quote

hy janmejay,

you want to know, the right smtp syntax,
with all mime extensions ans so on...

this will be a big task...

but if you only want to send text files,
just think, the text will be in the smtp stream
if plain or attached, does not matter!
if you have binary files, makes more sense
to attach them, i.e. zip, pdf ...

but i will give you a piece of advice...
google fpr XMITIP, you will find a freeware, which
will enable to send host files thru smtp in exactly
the way you need. We use this inhouse! It is FREE!

regards,
martin9
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: Tue Mar 16, 2010 4:58 pm
Reply with quote

Code:
MIME-Version: 1.0
Content-Type: text/plain
Content-Disposition: attachment; filename=file.txt
// DD DISP=SHR,DSN=???
// DD DISP=SHR,DSN=PERIOD.FILE
This works for me and sends the text file as an attachment named file.txt. If yours is not working, you should get with your site support group to work out what the problem is.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Problem while sending special charact... JCL & VSAM 4
No new posts How to append Previous date into a S... JCL & VSAM 2
No new posts Pack to Unpack conversion for sending... COBOL Programming 13
No new posts Connnect Direct Sending Zip file from... All Other Mainframe Topics 3
No new posts Need Help on sending email by includi... JCL & VSAM 9
Search our Forums:

Back to Top