if ( idSMTP.Connected ) then // if already connected, then disconnect from
the
IdSMTP.Disconnect; // SMTP server
IdSMTP.Host := fHostName;
IdSMTP.Port := 25;
try
IdSMTP.Connect();
if ( IdSMTP.Connected ) then
begin
if ( IdSMTP.AuthSchemesSupported.IndexOf('LOGIN') <> -1 )then
begin
IdSMTP.Username := UserName;
IdSMTP.Password := Password;
IdSMTP.AuthenticationType:=atLogin;
if ( IdSMTP.Authenticate = false ) then
begin
fErrorMessage := 'SMTP validation lost.';
IdSMTP.Disconnect;
exit;
end;
end;
end;
except
on E: Exception do
begin
fErrorMessage := 'Failed to connect to SMTP server'#13#10 + e.Message;
exit;
end;
end;
When it gets to IdSMTP.Authenticate = false I am getting the following
error:
EIdProtocolReplyError with message 'authentication failed - incorrect
username/password.'
When I telnet into the SMTP server I can connect and send test messages
successfully.
For the username and password I have tried both blank, with username my
network login I and password, and username = domain username, with my
correct password. I always get the EidProtocolReplyError being raised.
If I comment out the block of code for Authenticate, then I stop getting the
error, but no message is received
Is there something simple that I have missed?
thanks in advance
Darren
> When it gets to IdSMTP.Authenticate = false I am getting
> the following error:
>
> EIdProtocolReplyError with message 'authentication failed - incorrect
> username/password.'
>
> When I telnet into the SMTP server I can connect and send test
> messages successfully.
Did you MIME-encode the values when using Telnet? TIdSMTP does.
Did you try using a packet sniffer to see what exactly is different between
your manual commands and TIdSMTP's commands?
Gambit
So I altered my code to not do any login information, and did another trace
capture. Both packet captures appear the same to me.
"Remy Lebeau (TeamB)" <no....@no.spam.com> wrote in message
news:42123ff0$1...@newsgroups.borland.com...
So your program is now able to send emails properly?
Many SMTP servers don't require you to log on, they are authorising you
based on your IP address.
Ciaran
> Did a packet trace, and in the telnet connection it is
> not issuing the command AUTH LOGIN
Telnet will send whatever you type in yourself. If you do not type in AUTH
LOGIN yourself, then it will not be sent.
> So I altered my code to not do any login information, and did
> another trace capture. Both packet captures appear the same to me.
And does the problem still persist?
Also, did you configure Outlook with a username/password in the first place?
Did it ever send the AUTH LOGIN command?
Gambit
> Also, did you configure Outlook with a username/password
> in the first place? Did it ever send the AUTH LOGIN command?
Ignore that part, I was thinking of a different discussion elsewhere.
Gambit
There was nothing wrong with the code, tracked the problem down to Surf
Control on our mail server, it was identifying my test messages as spam, and
was holding them for review.
Working with our systems team to get around it
Darren