Author | Topic: Send email error: 550 Maximum line length exceeded | |
---|---|---|
Jack Duijf | Send email error: 550 Maximum line length exceeded on Sat, 30 Jul 2016 18:51:01 +0200 Hello, I started using MIMEMessage and SmtpClient to send e-mail messages. Now and then i receive an error from my hmailserver: Sent: Sat, 30 Jul 2016 17:52:47 +0200 Subject: Error log The following recipient(s) could not be reached: xxxxxxx@yyyyyyyyy.zz Error Type: SMTP Remote server (46.19.217.15) issued an error. hMailServer sent: . Remote server replied: 550 Maximum line length exceeded (see RFC 5322 2.1.1). hMailServer I never had this before when using See4Xb. The body contains a generated HTML page. The HTM page is cerytainly longer then 996 bytes What can i do to prevent this? Regards Jack Duijf ------------------------------------------------------------- Also a member off the XXP (http://www.xxp.nl) | |
Thomas Braun | Re: Send email error: 550 Maximum line length exceeded on Mon, 01 Aug 2016 08:44:11 +0200 Jack Duijf wrote: > Hello, > > I started using MIMEMessage and SmtpClient to send e-mail messages. [...] > I never had this before when using See4Xb. Just being curious... why did you change? I'm using See4Xb for many years now... I never would change to a less flexible method. > The body contains a generated HTML page. > The HTM page is cerytainly longer then 996 bytes > > What can i do to prevent this? You could try and insert line breaks into you HTML. Thomas | |
Jack Duijf | Re: Send email error: 550 Maximum line length exceeded on Mon, 01 Aug 2016 23:53:02 +0200 Hello Thomas, Thanks for your suggestion. On some ocasions, my app crashed when loading See32.dll fails.. This was just incidently the app (service) runs 24/7 CALLSTACK: ------------------------------------------------------------------------------ Called from SY_STANDARDEH(77) Called from (B)SY_ERRORSYS(57) Called from SENDMAIL:XSEESMTPCONNECT(1166) Called from SENDMAIL:CONNECT(854) Called from SENDMAIL:SEND(715) Called from SY_SENDEMAIL(1320) Called from MAILTHREAD:EXECUTE(429) ------------------------------------------------------------------------------ oError:args : P1 = VALTYPE: C VALUE: _DLL Now, this problem is gone after switching to 2.0 and smtpClient. I also implementen your suggestion into my HTML mail body. I inserted CRLF into the HTML. cBody := StrTran(cHtml,"<BR>","<BR>" + Chr(13) + Chr(10) ) It seems the errror is gone. Thanks, Regards, Jack Duijf On Mon, 01 Aug 2016 08:44:11 +0200, Thomas Braun wrote: >Jack Duijf wrote: > >> Hello, >> >> I started using MIMEMessage and SmtpClient to send e-mail messages. >[...] >> I never had this before when using See4Xb. > >Just being curious... why did you change? I'm using See4Xb for many years >now... I never would change to a less flexible method. > >> The body contains a generated HTML page. >> The HTM page is cerytainly longer then 996 bytes >> >> What can i do to prevent this? > >You could try and insert line breaks into you HTML. > >Thomas | |
Thomas Braun | Re: Send email error: 550 Maximum line length exceeded on Tue, 02 Aug 2016 08:35:23 +0200 Jack Duijf wrote: > > I also implementen your suggestion into my HTML mail body. > I inserted CRLF into the HTML. > > cBody := StrTran(cHtml,"<BR>","<BR>" + Chr(13) + Chr(10) ) Please be aware that this might lead to problems if SMTPClient is not really 100% RFC compliant. Since the <CRLF>.<CRLF> sequence ends the email, it can't be part of the mail body. According to https://tools.ietf.org/html/rfc821#section-4.5.2 the SMTP client has to check for this special case and treat it differently. In the past I had quite a bit of trouble with our mail server security scanner which re-arranged (sanitized) the HTML content of an email and once produced exactly this situation - practically truncating the email text in the middle of the email. Thomas | |
Jack Duijf | Re: Send email error: 550 Maximum line length exceeded on Tue, 02 Aug 2016 09:42:56 +0200 Hello Thomas, Thanks for your reply. So: in a nutshell. There is nothing i can do? Alaska'a SmtpClient() should take care of preventing 550 Maximum line length exceeded (see RFC 5322 2.1.1). ?? Regards Jack Duijf ------------------------------------------------------------- Also a member off the XXP (http://www.xxp.nl) | |
Thomas Braun | Re: Send email error: 550 Maximum line length exceeded on Tue, 02 Aug 2016 10:41:50 +0200 Jack Duijf wrote: > So: in a nutshell. > There is nothing i can do? You can - but you have to trust that SmtpClient() is RFC compliant, which you can check by creating a test email that contains a line with a single dot somewhere in the middle and check if the complete email arrives without being cut off at the dot. And just remember, the "S" im SMTP stands for "Simple" not for "Smart" > Alaska'a SmtpClient() should take care of preventing 550 Maximum line length exceeded (see RFC 5322 2.1.1). ?? According to RFC 5322, the limit is actually 998 (which ist 1000 - CRLF) and strictly speaking, this only applies to plain text email messages: ------- QUOTE 2.3. Body The body of a message is simply lines of US-ASCII characters. The only two limitations on the body are as follows: o CR and LF MUST only occur together as CRLF; they MUST NOT appear independently in the body. o Lines of characters in the body MUST be limited to 998 characters, and SHOULD be limited to 78 characters, excluding the CRLF. Note: As was stated earlier, there are other documents, specifically the MIME documents ([RFC2045], [RFC2046], [RFC2049], [RFC4288], [RFC4289]), that extend (and limit) this specification to allow for different sorts of message bodies. Again, these mechanisms are beyond the scope of this document. QUOTE -------- So, the error message "Remote server replied: 550 Maximum line length exceeded (see RFC 5322 2.1.1)." is either a bug in the receipient's mail server software (hmailserver.com) or in an incorrect handling of MIME messages by SmtpClient() - or even both. Maybe you should also contact the guys at https://www.spamexperts.com/ (which is the company behind the IP address from the error message) and ask them... Thomas |