Thanks for your response, Wilfried

> I'm not 100% sure, but I thought you dan step trough pascal units with
> cbuilder. Try to delete the SmtpProt.obj and SmtpProt.dcu files (maybe
> only one of them is there),  check the debug options in IDE and rebuild
> the project.

I tried removing SmtpProt.obj and SmtpProt.dcu but that did not help.  
the project will not cause the IDE referencing the new .obj file.  I am afraid 
"#pragma link" macro established the link at the time the ICS components were

Why I would like to trace into the SmtpProt.pas is that I encounter an error at 
the call to
procedure TCustomSmtpClient.DataNext.  The MailSnd1.cpp sample does the DATA
command in this way:

void __fastcall TMailSndForm::DataButtonClick(TObject *Sender)
 SmtpClient->HdrFrom         = FromEdit->Text;
 SmtpClient->HdrTo           = ToEdit->Text;
 SmtpClient->HdrSubject      = SubjectEdit->Text;
 SmtpClient->EmailFiles      = FileAttachMemo->Lines;

It relies on the TMailSndForm::SmtpClientGetData event handler to send the text 
in Memo
line by line.

My application is a console app so does not have the Memo.  What I do is assign 
the email
body to the SmtpClient->MailMessage property as in:

    SmtpClient->HdrFrom         = AnsiString(MY_MAIL_NAME);
    SmtpClient->HdrTo           = AnsiString(szMailRcpt);
    SmtpClient->HdrSubject      = AnsiString(MAIL_SUBJ_LINE);

The problem emerges when calling to procedure TCustomSmtpClient.DataNext, after

> X-Mailer: ICS SMTP Component V2.46

line is sent, FItemCount is still less than FHdrLines.Count, therefore

        StrPCopy(@MsgLine, FHdrLines.Strings[FItemCount]);

is called.  But the debugger indicates that FHdrLines.Strings[FItemCount] is a 
null pointer
so it throws an error.  I would like to trace FItemCount to see whether it 
matches the
number of lines assigned to the StringList in procedure TCustomSmtpClient.Data.

The content of MsgLine will be displayed when placing the mouse cursor on 
MsgLine, but that is
not workable on FItemCount.  Adding a watch the IDE shows "FItemCount E2109 Not 
an allowed type".

BTW, the mail can be sent out by ignoring the error.  Calling the exe out of 
the IDE does not have error
at all.

Anyone have idea what I did wrong?

Many thanks,

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to