Page 1 of 1

The demo sending email crashes

Posted: Tue Mar 01, 2016 4:46 pm
by russ3ell
I have downloaded the trial version of the product and I have now seen that it doesn't work with sending mail via outlook. So I had a look at Mime Demo and sending with Indy (we are using Indy 10). Unfortunately the demo crashes when I try to send the default message. I am using Delphi 7. Here is the code from BuildEmail:

txtpart := TIdText.Create(IdMessage1.MessageParts);
Stream := TMemoryStream.Create;
RichViewEdit1.SaveTextToStreamW('', Stream, 80, False, False);
Stream.Position := 0;
SetLength(ws, Stream.Size div 2);
if Stream.Size<>0 then
Stream.ReadBuffer(Pointer(ws)^, Stream.Size);
Stream.Free;
txtpart.Body.Text := ws;

It crashes when you set the body. However, when debugging, there is rubbish in ws.

Posted: Wed Mar 02, 2016 2:52 pm
by russ3ell
I have got this working. The issue was that we are working in Delphi 7 and this was working for a later version