I am looking for an example of using the MAPISendMail() function to send a file attachment, but am unsure of how to do it.
 
 
var
  MapiMessage: TMapiMessage;
  MError: Cardinal;
begin
  with MapiMessage do
  begin
    ulReserved := 0;
    lpszSubject := nil;
    lpszNoteText := PChar(Items.Lines.Text);
    lpszMessageType := nil;
    lpszDateReceived := nil;
    lpszConversationID := nil;
    flFlags := 0;
    lpOriginator := nil;
    nRecipCount := 0;
    lpRecips := nil;
    nFileCount := 0;
    lpFiles := nil;
  end;
 
  MError := MapiSendMail(0, 0, MapiMessage, MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0);
  if MError <> 0 then
    WarningBox('Error Sending EMAIL');
The code above sends a message, and I see there is nFileCount in the MapiMessage structure, but how do I put the attachment in the message.
 
If anyone has an example could they please forward it to me, or the list...
 
Cheers
 

Reply via email to