Author Topic: SMTP failed when receiving the DATA terminator response  (Read 1338 times)

davidy

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
SMTP failed when receiving the DATA terminator response
« on: November 27, 2017, 02:07:23 AM »
I am using Chilkat_9_5_0.MailMan to send email via SMTP and Chilkat_9_5_0.Email to create the mail object.
I am using loEmail.AddFileAttachment method to add the attachments to the email object.
On some systems (not all), it fails to send the email if there is an attachment getting the error SMTP failed when receiving the DATA terminator response.
Sends OK if there is no attachment.
It seems consistent for the systems that don't work but I cant see any pattern as to how they are any different from others that do work.
In addition, my development system no longer works either yet it used to. I don't have any idea what might have changed.
The error log appears normal except for the SMTP failed bit.
Log below

Cheers
David


ChilkatLog:
  SendEmail:
    DllDate: May  5 2017
    ChilkatVersion: 9.5.0.67
    UnlockPrefix: XXXXXXXXXXXXXXXXXX
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    Component successfully unlocked using purchased unlock code.
    sendEmailInner:
      renderToMime:
        createEmailForSending:
          Auto-generating Message-ID
        --createEmailForSending
        renderToMime: Elapsed time: 15 millisec
      --renderToMime
      sendMimeInner:
        progressTotal: 252147
        ensureSmtpSession:
          ensureSmtpConnection:
            SmtpHost: XXXXXXXXXXXXXXXXXXXXXXX
            SmtpPort: 25
            SmtpUsername:
            SmtpSsl: 0
            StartTLS: 0
            smtpConnect:
              smtpHostname: XXXXXXXXXXXXXXXXXXXXXXX
              smtpPort: 25
              connectionIsReady:
                Need new SMTP connection
              --connectionIsReady
              smtpSocketConnect:
                socketOptions:
                  SO_SNDBUF: 262144
                  SO_RCVBUF: 4194304
                  TCP_NODELAY: 1
                  SO_KEEPALIVE: 1
                --socketOptions
              --smtpSocketConnect
              smtpGreeting:
                readSmtpResponse:
                  SmtpCmdResp: 220 XXXXXXXXXXXXXXXXXXXX ESMTP Postfix
                --readSmtpResponse
              --smtpGreeting
              ehloCommand:
                sendCmdToSmtp:
                  SmtpCmdSent: EHLO TSM6DEV<CRLF>
                --sendCmdToSmtp
                readSmtpResponse:
                  SmtpCmdResp: 250-XXXXXXXXXXXXXXXXXX
                  SmtpCmdResp: 250-SIZE 20480000
                  SmtpCmdResp: 250-AUTH DIGEST-MD5 PLAIN LOGIN CRAM-MD5
                  SmtpCmdResp: 250 DSN
                --readSmtpResponse
              --ehloCommand
            --smtpConnect
          --ensureSmtpConnection
          ensureSmtpAuthenticated:
            smtpAuthenticate:
              No SMTP login provided.
              No SMTP password or OAuth2 access token provided.
              Skipping SMTP authentication because no login/password provided.
              smtp_host: hosted.theservicemanager.com
              smtp_port: 25
              smtp_user: NULL
              auth-method: NONE
              smtpAuthMethod: NONE
              smtpAuthenticate:
                login_method: NONE or already authenticated
              --smtpAuthenticate
              ConnectionType: Unencrypted TCP/IP
            --smtpAuthenticate
          --ensureSmtpAuthenticated
        --ensureSmtpSession
        sendSmtpEmail:
          sendNonPipelining:
            sendMailFrom:
              mailFrom: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
              sendCmdToSmtp:
                SmtpCmdSent: MAIL FROM:<XXXXXXXXXXXXXXXXXXXXXXX><CRLF>
              --sendCmdToSmtp
            --sendMailFrom
            readSmtpResponse:
              SmtpCmdResp: 250 2.1.0 Ok
            --readSmtpResponse
            rcptTo:
              sendRcptTo:
                sendCmdToSmtp:
                  SmtpCmdSent: RCPT TO:<XXXXXXXXXXXXXXXXXXXXXXXXX><CRLF>
                --sendCmdToSmtp
              --sendRcptTo
              readRcptTo:
                readSmtpResponse:
                  SmtpCmdResp: 250 2.1.5 Ok
                --readSmtpResponse
                recipient: XXXXXXXXXXXXXXXXXXXXXXXXXX
              --readRcptTo
            --rcptTo
            sendCmdToSmtp:
              SmtpCmdSent: DATA<CRLF>
            --sendCmdToSmtp
            readSmtpResponse:
              SmtpCmdResp: 354 Start mail input; end with <CRLF>.<CRLF>
            --readSmtpResponse
          --sendNonPipelining
          mimeDataSize: 251887
          sendDataToSmtp:
            numBytesSent: 251887
          --sendDataToSmtp
          sendCmdToSmtp:
            SmtpCmdSent: <CRLF>.<CRLF>
          --sendCmdToSmtp
          readSmtpResponse:
            idleTimeoutMs: 30000
          --readSmtpResponse
          SMTP failed when receiving the DATA terminator response.
        --sendSmtpEmail
      --sendMimeInner
    --sendEmailInner
    Failed.
  --SendEmail
--ChilkatLog

Chilkat

  • Administrator
  • Full Member
  • *****
  • Posts: 103
  • Karma: +6/-0
    • View Profile
Re: SMTP failed when receiving the DATA terminator response
« Reply #1 on: November 28, 2017, 09:50:10 AM »
When this error occurs, it mean the SMTP client (Chilkat) has completed the SMTP session (i.e. send the full MIME of the email message to the server) and is waiting for the SMTP server's final response -- but it never comes.

It may be that you need to wait longer than 30 seconds for the SMTP server to finally give a response.

One must realize that non-responsive SMTP servers happen from time to time.  For example, every once in a while, but not very often, in my day-to-day experience in replying to email using Mozilla Thunderbird, I'll experience a time where the email server (Outlook 365 in my case) just doesn't respond.  A retry solves the problem.  Chilkat as the SMTP client is in the same position as any other email client.  If the server just doesn't respond for no reason, then it could just be a temporary SNAFU on the server-side...


BenevolentDeity

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: SMTP failed when receiving the DATA terminator response
« Reply #2 on: January 08, 2018, 02:56:41 PM »
I don't have a solution but I can attest to seeing the same problem frequently.  I've been using Chilkat components for quite a few years and I typically see this problem on about 10% of the emails I send with attachments, and I'm never quite sure whether the attachment went through or not.  In an effort to combat possible SMTP server problems I use a rotating set of three different SMTP servers.  If I get this error on one of them my application automatically resends using the next one, and so on until I finally get success.  I've occasionally seen up to 6 failures in a row, meaning that all three servers failed twice, but eventually it works.  The down side of all this is that the recipient sometimes ends up getting multiple copies of the same email and attachments, but I guess that's one of the hazards of the game.