如何修复Chilkat ActiveX SendEmail错误

问题描述

使用Delphi Chilkat ActiveX。

我的IMAPS和TChilkatMailman(Mailman)连接成功。

Mailman.SMTPConnect和MailMan.SMTPAuthenticate都返回1,所以我认为我的连接很好。

这是我的delphi代码

@H_502_9@email2    := TChilkatEmail.Create(Self);
email2.Subject := 'Test Email';
email2.From    := '[email protected]';
email2.AddTo('simon wood','[email protected]');
email2.Body := 'An Email Body';
email2.Sender := '[email protected]';
mailman.SendEmail(email2.ControlInterface);

LastErrorText产生:

ChilkatLog:
  SendEmail:
    DllDate: Jun 25 2020
    ChilkatVersion: 9.5.0.83
    UnlockPrefix: CHEMIGRAPHMAILQ
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    sendEmailInner:
      renderToMime_pt1:
        createEmailForSending:
          Auto-generating Message-ID
        --createEmailForSending
      --renderToMime_pt1
      sendMimeInner:
        ensureSmtpSession:
          ensureSmtpConnection:
            smtpParams:
              SmtpHost: smtp.office365.com
              SmtpPort: 587
              SmtpUsername: 
              SmtpSsl: 0
              StartTLS: 1
            --smtpParams
            smtpConnect:
              smtpHostname: smtp.office365.com
              smtpPort: 587
              connectionIsReady:
                Using existing/open SMTP connection to send email.
              --connectionIsReady
              Reconnecting because the connection has been idle for too long.
              smtpSocketConnect:
                socketoptions:
                  SO_SNDBUF: 262144
                  SO_RCVBUF: 4194304
                  TCP_NODELAY: 1
                  SO_KEEPALIVE: 1
                --socketoptions
              --smtpSocketConnect
              smtpGreeting:
                readSmtpResponse:
                  SmtpCmdResp: 220 LO2P265CA0380.outlook.office365.com Microsoft ESMTP MAIL Service ready at Tue,11 Aug 2020 13:59:35 +0000
                --readSmtpResponse
              --smtpGreeting
              startTLS:
                sendCmdToSmtp:
                  SmtpCmdsent: EHLO SIMON
                --sendCmdToSmtp
                readSmtpResponse:
                  SmtpCmdResp: 250-LO2P265CA0380.outlook.office365.com Hello [217.20.31.34]
                  SmtpCmdResp: 250-SIZE 157286400
                  SmtpCmdResp: 250-PIPELINING
                  SmtpCmdResp: 250-DSN
                  SmtpCmdResp: 250-ENHANCEDSTATUSCODES
                  SmtpCmdResp: 250-STARTTLS
                  SmtpCmdResp: 250-8BITMIME
                  SmtpCmdResp: 250-BINARYMIME
                  SmtpCmdResp: 250-CHUNKING
                  SmtpCmdResp: 250 SMTPUTF8
                --readSmtpResponse
                sendCmdToSmtp:
                  SmtpCmdsent: STARTTLS
                --sendCmdToSmtp
                readSmtpResponse:
                  SmtpCmdResp: 220 2.0.0 SMTP server ready
                --readSmtpResponse
                TLS connection established.
              --startTLS
              ehloCommand:
                sendCmdToSmtp:
                  SmtpCmdsent: EHLO SIMON
                --sendCmdToSmtp
                readSmtpResponse:
                  SmtpCmdResp: 250-LO2P265CA0380.outlook.office365.com Hello [217.20.31.34]
                  SmtpCmdResp: 250-SIZE 157286400
                  SmtpCmdResp: 250-PIPELINING
                  SmtpCmdResp: 250-DSN
                  SmtpCmdResp: 250-ENHANCEDSTATUSCODES
                  SmtpCmdResp: 250-AUTH LOGIN XOAUTH2
                  SmtpCmdResp: 250-8BITMIME
                  SmtpCmdResp: 250-BINARYMIME
                  SmtpCmdResp: 250-CHUNKING
                  SmtpCmdResp: 250 SMTPUTF8
                --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: smtp.office365.com
              smtp_port: 587
              smtp_user: NULL
              auth-method: NONE
              smtpAuthMethod: NONE
              smtpAuthenticate:
                login_method: NONE or already authenticated
              --smtpAuthenticate
              ConnectionType: SSL/TLS
            --smtpAuthenticate
          --ensureSmtpAuthenticated
        --ensureSmtpSession
        sendSmtpEmail:
          sendWithPipelining:
            sendMailFrom:
              mailFrom: [email protected]
              sendCmdToSmtp:
                SmtpCmdsent: MAIL FROM:
              --sendCmdToSmtp
            --sendMailFrom
            sendRcptTo:
              sendCmdToSmtp:
                SmtpCmdsent: RCPT TO:
              --sendCmdToSmtp
            --sendRcptTo
            sendCmdToSmtp:
              SmtpCmdsent: DATA
            --sendCmdToSmtp
            readSmtpResponse:
              WindowsError: An existing connection was forcibly closed by the remote host.
              WindowsErrorCode: 0x2746
              maxToReceive: 152
              Failed to receive data on the TCP socket
              Failed to read TLS record (2)
              tlsRec_msg: 0
              msgLen: 152
              nReadNBytes: 0
              status: 0
              Failed to receive more TLS application data.
              tlsApp: Socket Fatal error.
            --readSmtpResponse
          --sendWithPipelining
        --sendSmtpEmail
      --sendMimeInner
    --sendEmailInner
    Failed.
  --SendEmail
--ChilkatLog

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)