|
An even more efficient way, perhaps, is to use varying-length variables.
If, that is, these functions can use them or if RPG will properly make
them work - I think it might.
But varying-length generally work faster when building long string
variables than using %trim(). And the code is ever so much cleaner.
Cheers
Vern
On 2/14/2022 8:56 AM, Steve M via MIDRANGE-L wrote:
Jim,"body",
That makes totals sense. Somewhere in the memory space allocated to
trailing your actual data, there was garbage causing your issue. It justJim
shows, once again, just how important %Trim can be to success. I think I
use that BIF almost as much as any other, for just the same kinds of
reasons.
Glad it all worked out.
Steve M.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Hawkinsago
Sent: Monday, February 14, 2022 07:46
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Email from Power systems
A month or two back, there was some discussion about issues sending email
from a power system. We have been doing this for some time, but a year
we converted from an inhouse mail server to using the cloud 365 emailserver
and many of our emails stopped arriving at the destination with a bounceallowed.
back error code of 500 indicating that a text line was longer than
One of my predecessors wrote a program called procedure that we use for'>' +
sending emails. The heart of this procedure has the following code:
header = 'From: ' + fromName + ' <' + fromAddr +
CRLFindicator)
+'To: ' + toName + ' <' + toAddr + '>' + CRLF
+'Date: ' + MailDate() + CRLF
+'Subject: ' + subject + CRLF
+'MIME-Version: 1.0' + CRLF
+'Content-Type: text/html' + CRLF
+ CRLF;
callp write(fd: %addr(header)+2: %len(header));
//d02callp write(fd: %addr(body)+2: %len(body));
callp write(fd: %addr(body)+2: %len(%trim(body))); //a02
callp close(fd);
//
---------------------------------------------------------------------
// Send the e-mail
//
---------------------------------------------------------------------
fromLen = %len(%trim(fromAddr));
namelen = %len(%trim(filename));
sendmail(filename:namelen: fromAddr:fromLen:
%addr(RecipTbl):NbrRecips:ErrorCode);
About 2 weeks ago I deleted a line of this code (leading //d02
and added a new line of code (trailing //a02 indicator). This appears tofrom an
have resolved the issue we were having.
Hoping that this might help someone else.
Before someone asks: I think the entire code was from was "borrowed"
online source, but there is nothing in the documentation indicatingwhere,
as such, I am not willing to share the entire code set.list
Regards,
Jim Hawkins
Programmer Analyst
Interkal LLC
Kalamazoo, MI
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,link:
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.