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 12:24PM
    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 12:24PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.