Page 1 of 1

Sending multiple emails using mainframes.

Posted: Mon May 08, 2017 9:27 pm
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?

Re: Sending multiple emails using mainframes.

Posted: Mon May 08, 2017 10:13 pm
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.

Re: Sending multiple emails using mainframes.

Posted: Tue May 09, 2017 12:00 am
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).

Re: Sending multiple emails using mainframes.

Posted: Mon Jul 10, 2017 4:13 pm
by Ashish Mathew
Thanks Robert. I wanted to send it to multiple recipients and it worked with multiple rcpt to:.