Question:
I try to use version 9.5.0 in Delphi 2010.
When I send email I get error:
Type : EIntfCastError
Message : Interface not supported.
mailman := TChilkatMailMan.Create(Self);
email := TChilkatEmail.Create(Self);
success := mailman.SendEmail(email As IChilkatEmail); //error here: Interface not supported
Has anyone can help?
Change the call to SendEmail to look like this instead:
success := mailman.SendEmail(email.ControlInterface);
The IChilkatEmail interface should be present. I have verified it.
Note: The single-DLL ActiveX uses "IChilkatEmail", whereas the deprecated multiple DLL ActiveX's use "IChilkatEmail2".
Follow these steps carefully:
function TChilkatMailMan.FetchEmail(const uidl: WideString): IChilkatEmail; begin Result := DefaultInterface.FetchEmail(uidl); end;
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_v9_5_0_TLB;
I verified Chilkat_v9_5_0_TLB and IChilkatEmail Exists.
ActiveX works properly from VB script but not from Delphi.
"Interface not supported" is displayed.
I tested it on second computer with Delphi 2010 with the same result.
I would add that the code compiles. Error appears at runtime.
Thank you. This solution works. Please update examples for Delphi.