Search code examples
imapchilkat-email

Chilkat: SmtpCmdResp: 354 Enter message, ending with "." on a line by itself


I try to use Chilkat AppendMail method to store sent email in Sent mailbox

$oIMAP.AppendMail($sMailbox_name, $oEmail)

Mostly it works fine. But on some end clients configurations I get:

              --sendCmdToSmtp
            --sendRcptTo
            sendCmdToSmtp:
              SmtpCmdSent: DATA<CRLF>
            --sendCmdToSmtp
            readSmtpResponse:
              SmtpCmdResp: 250 OK
            --readSmtpResponse
            readRcptTo:
              readSmtpResponse:
                SmtpCmdResp: 250 Accepted
              --readSmtpResponse
              recipient: *****@destination.pl
            --readRcptTo
            readRcptTo:
              readSmtpResponse:
                SmtpCmdResp: 250 Accepted
              --readSmtpResponse
              recipient: *****@sender.pl
            --readRcptTo
            readSmtpResponse:
              SmtpCmdResp: 354 Enter message, ending with "." on a line by itself
            --readSmtpResponse
          --sendWithPipelining
          sendCmdToSmtp:
            SmtpCmdSent: <CRLF>.<CRLF>
          --sendCmdToSmtp
          readSmtpResponse:
            SmtpCmdResp: 250 OK id=1nypCX-0005r9-EO
          --readSmtpResponse
        --sendSmtpEmail
      --sendMimeInner
    --sendEmailInner
    Success.
  --SendEmail
--ChilkatLog

My question is why 354 Enter message, ending with "." on a line by itself occurs ?

I already read: sendmail error Enter mail, end with "." on a line by itself

and: https://serverfault.com/questions/509464/error-message-not-sent-server-replied-354

where I read: Whoever wrote the webmail program needs to go back and read RFC 5321 again and then fix the bug.

So I wonder if it is something wrong with Chilkat component ? Or I need to change something in my code ?


Solution

  • My guess is that you have instances of both the MailMan object (for SMTP) and the IMAP object. You call MailMan.SendEmail to send the email, and it works fine. Then you make a call to an Imap method to copy (append) the sent email to the "Sent" folder on the mail server. The Imap call fails, but then you mistakenly show the mailman.LastErrorText instead of the imap.LastErrorText.