TScTextAttachment.create has changed on Version 10

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Schlueter
Posts: 16
Joined: Thu 29 Aug 2013 06:57

TScTextAttachment.create has changed on Version 10

Post by Schlueter » Wed 22 Sep 2021 08:52

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

YanishevskiyVI
Devart Team
Posts: 70
Joined: Wed 02 Jun 2021 09:30

Re: TScTextAttachment.create has changed on Version 10

Post by YanishevskiyVI » Thu 23 Sep 2021 08:54

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

Schlueter
Posts: 16
Joined: Thu 29 Aug 2013 06:57

Re: TScTextAttachment.create has changed on Version 10

Post by Schlueter » Thu 23 Sep 2021 09:03

Hi Vitaly,

thank you very much.

Best regards
Rolf

YanishevskiyVI
Devart Team
Posts: 70
Joined: Wed 02 Jun 2021 09:30

Re: TScTextAttachment.create has changed on Version 10

Post by YanishevskiyVI » Thu 23 Sep 2021 12:14

Hi Rolf,

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

Regards,
Vitaliy

Post Reply