indy 10 raises exceptions in tidattachment (by calling OpenLoadStream) and by us

Giganews Newsgroups
Subject: indy 10 raises exceptions in tidattachment (by calling OpenLoadStream) and by us
Posted by:  JN (die…@gmx.de)
Date: Sat, 5 Jun 2004

1)
the following code raises an exception on procesing the following line:
"idsmtp1.Send(IdMessage1)"
(IdMessage1.SaveToStream / SaveToFile and tidattachment.SaveToFile raises
the same
exception)

----------------------------------------------------------------------------
IdMessage1.Clear;
IdMessage1.From.Address := 'hel…@gmx.de';
IdMessage1.Subject := 'Testsubject;
with IdMessage1.Recipients.Add do
  Address := 'te…@gmx.de';
IdMessage1.Body.Text := 'Testbody';

tidattachment.Create(IdMessage1.MessageParts).FileName := 'E:\1.rtf';

idsmtp1.Connect;
idsmtp1.Send(IdMessage1);
idsmtp1.Disconnect;
----------------------------------------------------------------------------

the error message is "abstractly error" (i like those very specific delphi
messages ;-) ) and was raised by line 1164 in IdMessageClient
(procedure: "TIdMessageClient.SendBody"
Code in this line:  "LSrcStream :=
TIdStreamVCL.Create(TIdAttachment(AMsg.MessageParts[i]).OpenLoadStream,
False);"

and from tidattachment.SaveToFile in Line
"os := OpenLoadStream;"

Every time OpenLoadStream is called the exception is raised !!!

is there anything wrong in our code or in indy code ?

in indy 9 we used "tidattachment.Create(IdMessage1.MessageParts,
'E:\1.rtf');" and everything works fine ...

2)
by using TIdSMTP with AuthType = atSASL with one or more
assigned  SASLMechanisms (like IdSASLCRAMMD5) an
exception was raised by calling idsmtp1.Send(IdMessage1)
"Access violation by reading address 00000000"!

the exception is raised by line 156 in function TIdSASLEntries.LoginSASL in
IDSASLCollection.pas
Code in Line: "LS.SASL.Assign(Items[i].SASL);"

Thanks for any hints!

Jens

Replies