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.

Topic author
Ashish Mathew
Registered Member
Posts: 38
Joined: Thu Jun 27, 2013 6:17 pm
Has thanked: 1 time

Sending multiple emails using mainframes.

Postby Ashish Mathew » Mon May 08, 2017 9:27 pm

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?



Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: Sending multiple emails using mainframes.

Postby Robert Sample » Mon May 08, 2017 10:13 pm

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.



Online
User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1275
Joined: Fri Jun 28, 2013 1:22 am
Location: East Dubuque Illinois
Has thanked: 2 times
Been thanked: 90 times

Re: Sending multiple emails using mainframes.

Postby Robert Sample » Tue May 09, 2017 12:00 am

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).




Topic author
Ashish Mathew
Registered Member
Posts: 38
Joined: Thu Jun 27, 2013 6:17 pm
Has thanked: 1 time

Re: Sending multiple emails using mainframes.

Postby Ashish Mathew » Mon Jul 10, 2017 4:13 pm

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




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

Who is online

Users browsing this forum: Baidu [Spider], CommonCrawl [Bot] and 2 guests