Problem with sending mail

edited October 2010 in FastReport 4.0
Good evening All,

I tried to use the TfrxMailExport component but it seems it doesn't work and I am not the first who has this problem.
Anyway, as i built my own client mail with Indy before using FR I 'd like to use it within FR instead of using TfrxMailExport component. Instead of loading the FR mail form in the preview when I click on the mail button I'd like to load my own client mail which is located in a .DLL file.

In my application I load the client mail as this :

For the declaration :
Procedure fmMail(HandleApp :Integer;);StdCall;External MyDll.dll';

For the call :
var
Handle : THandle;
Ptr : TFarProc;
Begin
 HandleApp:=Application.Handle;
 Handle := LoadLibrary ('MyDll.dll');
 Ptr := GetProcAddress (Handle,  'fmMail');
 If Ptr <> NIL Then
  Begin   fmMail(HandleAppl);
  Ptr := Nil;
  End;
End;

Can I write that code where FR mail form is called ?

Thanks.

Comments

  • gpigpi
    edited 1:49AM
    Try
    procedure TForm1.ButtonClick(Sender: TObject);
    begin
         ShowMessage('My Button pressed');
    end;
    
    procedure TForm1.frxReport1Preview(Sender: TObject);
    var
      Button: TSpeedButton;
    begin
      // add new button
      Button := TSpeedButton.Create(TfrxPreviewForm(frxReport1.PreviewForm).ToolBar);
      Button.Parent:=TfrxPreviewForm(frxReport1.PreviewForm).ToolBar;
      Button.Caption:='My Button';
      Button.Width:=60;
      Button.Left:=650;
      Button.OnClick:=ButtonClick;
      TfrxPreviewForm(frxReport1.PreviewForm).EmailB.OnClick:=ButtonClick;
      end;
    
  • edited 1:49AM
    Good Morning,

    It works fine !!!

    Thank you very much gpi [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />) Best Regards[/img]

Leave a Comment