Here another message from Stephane.
He found another minor problem:

----- Original Message ----- 
From: "Vander Clock Stephane" <[EMAIL PROTECTED]>
To: "Francois PIETTE" <[EMAIL PROTECTED]>
Sent: Saturday, November 05, 2005 9:33 AM
Subject: Re: [twsocket] Fw: TCustomSmtpClient.AuthGetType


in a similar way

procedure TCustomSmtpClient.DoAuthPlain;
var
   AuthPlain : String;
begin
   AuthPlain := FUserName;
   AuthPlain := AuthPlain + #0;
   if FFromName <> '' then { FromName should be set before calling Auth }
       AuthPlain := AuthPlain + FFromName
   else
       AuthPlain := AuthPlain + FUserName;
   AuthPlain := AuthPlain + #0;
   AuthPlain := AuthPlain + FPassword;
   AuthPlain := Base64Encode(AuthPlain);
   ExecAsync(smtpAuth, 'AUTH PLAIN ' + AuthPlain, [235], AuthNextPlain);
end;

as in the function

procedure TCustomSmtpClient.MailFrom;
var
   FriendlyName : String;
begin
   FFctPrv := smtpFctMailFrom;
   ExecAsync(smtpMailFrom,
             'MAIL FROM:<' + ParseEmail(FFromName, FriendlyName) + '>',
             [250], nil)
end;

you consider that FFromName can have the form "myname <[EMAIL PROTECTED]>", I
think you should do the same in function DoAuthPlain...

procedure TCustomSmtpClient.DoAuthPlain;
var
   AuthPlain : String;
begin
   AuthPlain := FUserName;
   AuthPlain := AuthPlain + #0;
   if ParseEmail(FFromName, FriendlyName) <> '' then { FromName should be
set before calling Auth }
       AuthPlain := AuthPlain + ParseEmail(FFromName, FriendlyName)
   else
       AuthPlain := AuthPlain + FUserName;
   AuthPlain := AuthPlain + #0;
   AuthPlain := AuthPlain + FPassword;
   AuthPlain := Base64Encode(AuthPlain);
   ExecAsync(smtpAuth, 'AUTH PLAIN ' + AuthPlain, [235], AuthNextPlain);
end;


a++
st├ęphane

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to