Last month, we used Delphi + indy9 to write a DLL file for SMTP mail sending for the company's ERP system (PowerBuilder.
A problem is found during use. When the subject of the email is too long, the recipient will receive a garbled email.
After searching on the network, I checked Indy'sSource codeThe problem is that Indy uses base64 encoding to encode the subject, such as Chinese and non-ASCII characters. If the encoded content exceeds 75 bytes, it is split into multiple lines. A carriage return line break is added between the row and the row.
How can I solve the problem?
I was going to modify the multi-row Processing Method of Indy. The result was half-day old. Then I simply changed the limit of 75 bytes to 175 bytes, and the test was OK.
So let's do it first.
The specific modification location is in line 599th of delphi_path \ source \ Indy \ idcoderheader. Pas.