I am having a real problem getting the lnet smtp client to work. the auth
seems to be failing.
if I use the example where I have to type in the user name and password
authentication passes. But if I set the username and pass in programming it
fails authentication.
What is even more strange is the results returned seems to indicate that the
user names and passwords are the same.
Any Ideas?
affected code below
-------------------------------------------------------------------------------------------------
procedure TLSMTPClientTest.Run(BarExtn,BarDest,BarTime,
BarcallerName,BarSQLduration,BarCharge,BarDestName: String);
var
s, p, Addr, Subject, Sender, Recipients, server, Message: string;
sendcheck, authcheck : integer;
Port: Word = 25;
begin
FQuit := False;
sendcheck := 1; // Check if we can send
authcheck := 1; // Check if auth required
s := 'mynane'; // first get username
p := 'mypass'; // first get password
server := 'mail.phi.co.uk'; // first get password
Subject := 'Barred Number dialled '+BarDest
Message := 'Destination: '+BarDestName+CRLF;
Message := Message+'Date/Time: '+BarTime+CRLF;
Message := Message+'Duration: '+BarSQLDuration+CRLF;
Message := Message+'Cost: '+BarCharge+CRLF;
Write('Connecting to ', server, ':', Port, '... ');
if sendcheck = 1 then begin
if FSMTP.Connect(server, Port) then repeat // try to connect
FSMTP.CallAction; // if inital connect went ok, wait for
"acknowlidgment" or otherwise
until FQuit or FSMTP.Connected; // if user quit, or we connected,
then continue
if not FQuit then begin // if we connected send HELO
FSMTP.Ehlo;
end;
while not FQuit do begin // if we connected, do main loop
FSMTP.CallAction; // main event mechanism, make sure to call
periodicly and ASAP, or specify high timeout
if authcheck = 1 then FSMTP.AuthLogin(s, p); // then get password
(mask it) and pass to auth
FSMTP.SendMail(Sender, Recipients, Subject, Message);
end;
FQuit := True;
FSMTP.Quit;
end;
end;
---------------------------------------------------------------------------------------------
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus