Hi Yanbo;
It aint easy. I have worked with that one too. There are some freeware
components which help to do Simple MAPI, but depending on Win 95/98
configuration the freeware prods are not totally reliable.
However there must be some way to do it with OLE, as if you right click a
file, then you can actually send it to the mail product as an attachment.
Good luck and lets know how you get on.
Alistair+
>I am using MapiSendMail in my application. If I attach a file in the mail,
I alway get an error message. do I misunderstand something?
>
>Regards
>Yanbo
>
>
>procedure TLogoAppForm.FileSend1Execute(Sender: TObject);
>var
>  MapiMessage: TMapiMessage;
>  MError: Cardinal;
>  MapiFileDesc  :  array[0..1] of TMapiFileDesc;
>begin
>  MapiFileDesc[0].ulReserved := 0;
>//  MapiFileDesc[0].flFlags :=  MAPI_OLE_STATIC;
>  MapiFileDesc[0].nPosition := 0;
>  MapiFileDesc[0].lpszPathName :=PChar('C:\windows\');
>  MapiFileDesc[0].lpszFileName :=PChar('myTextFile');
>
>  with MapiMessage do
>  begin
>    ulReserved := 0;
>    lpszSubject := nil;
>    lpszNoteText := PChar('My typed text ' );
>    lpszMessageType := nil;
>    lpszDateReceived := nil;
>    lpszConversationID := nil;
>    flFlags := 0;
>    lpOriginator := nil;
>    nRecipCount := 0;
>    lpRecips := nil;
>    nFileCount := 1;
>    lpFiles := @MapiFileDesc;
>  end;
>
>  MError := MapiSendMail(0, 0, MapiMessage,
>    MAPI_DIALOG {or MAPI_LOGON_UI or MAPI_NEW_SESSION}, 0);
>    if MError <> 0 then MessageDlg(' Send error', mtError, [mbOK], 0);
>end;
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to