Sending multiple emails using mainframes.

Other Mainframe related questions which attracts you and there is no suitable Forum you find for it and related FAQs.
Post Reply
Ashish Mathew
Registered Member
Posts: 50
Joined: Thu Jun 27, 2013 6:17 pm

Sending multiple emails using mainframes.

Post by Ashish Mathew »

Hi,

I'm sending emails from mainframes and it seems to work fine if I sent out a single email but if I try to sent out multiple email to different email IDs it seems it is not recognising the end of the first email and the start of the second email. I write HELO record in the start of each email though. Is there some other way to do it?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Sending multiple emails using mainframes.

Post by Robert Sample »

As long as you are using SMTP, the answer is no. RFC 2821 (the SMTP standard) specifically states in 4.1.1.4:
The mail data is terminated by a line containing only a period, that
is, the character sequence "<CRLF>.<CRLF>" (see section 4.5.2). This
is the end of mail data indication. Note that the first <CRLF> of
this terminating sequence is also the <CRLF> that ends the final line
of the data (message text) or, if there was no data, ends the DATA
command itself.
and
Receipt of the end of mail data indication requires the server to
process the stored mail transaction information. This processing
consumes the information in the reverse-path buffer, the forward-path
buffer, and the mail data buffer, and on the completion of this
command these buffers are cleared. If the processing is successful,
the receiver MUST send an OK reply. If the processing fails the
receiver MUST send a failure reply. The SMTP model does not allow
for partial failures at this point: either the message is accepted by
the server for delivery and a positive response is returned or it is
not accepted and a failure reply is returned. In sending a positive
completion reply to the end of data indication, the receiver takes
full responsibility for the message (see section 6.1). Errors that
are diagnosed subsequently MUST be reported in a mail message, as
discussed in section 4.4.
So once you've put in the final period to end an email, the SMTP process is to complete that email and clear the buffers -- hence putting another HELO in the data stream means it WILL be ignored.

You may be able to use another mainframe email processing package to do what you want, but with native SMTP what you want to do cannot be done. Use separate jobs (or separate steps of one job) to send multiple emails.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Sending multiple emails using mainframes.

Post by Robert Sample »

One additional comment: if you're wanting to send the same email to multiple recipients, that is easily done within SMTP -- just use multiple rcpt to: lines, one per recipient. However, if you're wanting to send out totally different emails to different recipients -- this is what cannot be done and requires either multiple steps in a job or multiple jobs (one step / job per email).
Ashish Mathew
Registered Member
Posts: 50
Joined: Thu Jun 27, 2013 6:17 pm

Re: Sending multiple emails using mainframes.

Post by Ashish Mathew »

Thanks Robert. I wanted to send it to multiple recipients and it worked with multiple rcpt to:.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Other Mainframe Topics, Off-Topics, FAQs.”