× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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 ago we converted from an inhouse mail server to using the cloud 365 email server and many of our emails stopped arriving at the destination with a bounce back error code of 500 indicating that a text line was longer than allowed. 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 + '>' + CRLF
+'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 indicator) and added a new line of code (trailing //a02 indicator). This appears to 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" from an online source, but there is nothing in the documentation indicating where, as such, I am not willing to share the entire code set.

Regards,

Jim Hawkins
Programmer Analyst
Interkal LLC
Kalamazoo, MI



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.