Discussion:
Trapping "valid RCPT command must precede DATA" error
(too old to reply)
M.E.
2008-07-14 18:50:55 UTC
Permalink
Using D7 and Indy9' TIdSMTP I was always getting this error "valid RCPT
command must precede DATA".
Googling for this error I found for the Outlook Express people say the user
should check the option "my server requires authentication".
So, I included a "SMTP.Authenticate" after connecting.
The question is: how do I trap that error so I can tell my user to check the
"my server requires authentication" checkbox I've included in my
application?
Thanks
Marcio Ehrlich
Remy Lebeau (TeamB)
2008-07-14 20:16:41 UTC
Permalink
Post by M.E.
Using D7 and Indy9' TIdSMTP I was always getting this error
"valid RCPT command must precede DATA".
Sounds like you are not specifying any recipients for the message you are
trying to send.
Post by M.E.
Googling for this error I found for the Outlook Express people
say the user should check the option "my server requires
authentication". So, I included a "SMTP.Authenticate" after
connecting.
TIdSMTP.Send() calls Authenticate() internally for you.
Post by M.E.
how do I trap that error so I can tell my user to check the
"my server requires authentication" checkbox I've included
in my application?
Simply wrap the Send() in a try..except block, and then analyze the text of
the exception message when catch.


Gambit

Loading...