I was getting complaints that some emails generated by SNDEMAIL were
occasionally having the wrong attachment go out on the wrong email. 'twas
a teensy bit embarrassing when a customer opens an email to find someone's
payroll stub on it. Yes, I sheepishly admit, we put up with this for
years. Trying stuff like scheduling payroll emails at off hours. This
week we decided to forcefully address it. Using knowledge from:
http://www.scottklement.com/rpg/ifs_ebook/index.html
I whipped up a program to generate 500 attachments
http://code.midrange.com/4db6c4a96c.html
Then I whipped up a command, and a program, to shoot out a range of these
attachments to a group of email addresses.
http://code.midrange.com/e0e7b9e69e.html
I sent out 1-100 to ...001 at yahoo, 101-200 to ...002 at yahoo, 201-300
to ...003 at yahoo, 301-400 to ...004 at yahoo and 401-500 to ...005 at
yahoo. I did this by submitting 5 jobs to a multistring job queue that
was on hold. When all 5 jobs were queued up I released the job queue. I
waited. Then I opened up each of the 500 emails, 100 per account.
Occasionally I did find a wrong attachment. Occasionally I did find a
wrong body too. I liked finding the wrong body too. This was more
consistent on where I felt the code was wrong.
I changed these lines from SNDEMAILC:
http://code.midrange.com/6764bad653.html
Prior to this change there was no ALCOBJ going on. I suspected that
multiple people were doing a RTVDTAARA prior to either doing a CHGDTAARA.
Thus getting the same sequence number and therefore the same mime file.
After this change I duplicated my test on the production system. Again I
scanned 500 emails. Perfect. So I promoted to production and reran it.
Again I scanned 500 emails. Perfect.
Note: One change we made previously was putting a library on the data
area. We had some jobs that actually did not have QGPL in their library
list. Replies picking on why we have such jobs will be ignored. Other
than that, I am open for suggestions.
If you are using SNDEMAIL at your shop then I suggest you consider this
change.
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.