Page 1 of 1

TScTextAttachment.create has changed on Version 10

Posted: Wed 22 Sep 2021 08:52
by Schlueter
Hi,

I've used following code for binding HTML-textfiles to the e-mail textbody:

Code: Select all

var   msg: TScMailMessage;
begin
  ... 
  
  with TScTextAttachment.Create(msg.Attachments, nil) do
    begin
    Body.LoadFromFile(fileName);
    ContentType := 'text/html';
    end;
	
  ...
end;
By updating to Version 10.0.1 I can't compile my code any longer, because of type mismatch:
[dcc32 error] .. E2010 incompatible types: 'TScAlternateViewCollection' and 'TScAttachmentCollection'
What can I do?

Best regards
Rolf

Re: TScTextAttachment.create has changed on Version 10

Posted: Thu 23 Sep 2021 08:54
by YanishevskiyVI
Hi Rolf!

Thank you for your inquiry!

Please try to replace in your code

Code: Select all

msg.Attachments
with

Code: Select all

msg.AlternateViews
Regards,
Vitaliy

Re: TScTextAttachment.create has changed on Version 10

Posted: Thu 23 Sep 2021 09:03
by Schlueter
Hi Vitaly,

thank you very much.

Best regards
Rolf

Re: TScTextAttachment.create has changed on Version 10

Posted: Thu 23 Sep 2021 12:14
by YanishevskiyVI
Hi Rolf,

You are always welcome!
Should you have any other questions, do not hesitate to ask!

Regards,
Vitaliy