mirage228
Mitglied
Also ich wollte in meinem Programm Texte als Anlage per EMail verschicken können. Ich komme aber mit lpFiles vom Typ PMapiFileDesc net klar! Wie soll man den definieren.
Der Hilfedatei auszug ist leider nur für C++:
typedef struct {
ULONG ulReserved;
ULONG flFlags;
ULONG nPosition;
LPTSTR lpszPathName;
LPTSTR lpszFileName;
LPVOID lpFileType;
} MapiFileDesc, FAR *lpMapiFileDesc;
Members
ulReserved
Reserved; must be zero.
flFlags
Bitmask of attachment flags. The following flags can be set:
MAPI_OLE
Indicates the attachment is an OLE object file attachment. If MAPI_OLE_STATIC is also set, the object is static. If neither flag is set, the attachment is simply a data file.
MAPI_OLE_STATIC
Set to iIndicates a static OLE object file attachment.
nPosition
Integer used in the MapiMessage structure member lpszNoteText to indicate at which character the attachment should be rendered in the message body. The application renders an attachment within the message text at the character and offset designated by lpszNoteText[nPosition] in MapiMessage. A value of - 1 (0xFFFFFFFF) means attachment position is not indicated in this way.
lpszPathName
Pointer to the fully qualified path of the attachment file. This path should include the disk drive letter and directory name.
lpszFileName
Optional pointer to the attachment filename seen by the recipient, which may differ from the filename in the lpszPathName member if temporary files are being used. If the lpszFileName member is empty or NULL, the filename from lpszPathName is used.
lpFileType
Optional pointer to a descriptor that can be used to indicate to message recipients the type of the attached file; an example is a filename extension such as .DOC. A value of NULL indicates an unknown or operating system-
determined file type.
---
Quellcode in meinem Programm: [das was da steht hab ich grösstenteils aus ner Delphi Demo kopiert]
procedure TMain.SendBtnClick(Sender: TObject);
var
MapiMessage: TMapiMessage;
MError: Cardinal;
begin
with MapiMessage do
begin
ulReserved := 0;
lpszSubject := nil;
lpszNoteText := nil;
lpszMessageType := nil;
lpszDateReceived := nil;
lpszConversationID := nil;
flFlags := 0;
lpOriginator := nil;
nRecipCount := 0;
lpRecips := nil;
nFileCount := 0;
lpFiles := nil; // Was muss man hier schreiben???
end;
MError := MapiSendMail(0, 0, MapiMessage,
MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0);
if MError <> 0 then Application.MessageBox('Nachrichtenerstellung beendet.','Warnung',48);
end;
---
Kann mir einer Helfen?
thx, mirage228
Der Hilfedatei auszug ist leider nur für C++:
typedef struct {
ULONG ulReserved;
ULONG flFlags;
ULONG nPosition;
LPTSTR lpszPathName;
LPTSTR lpszFileName;
LPVOID lpFileType;
} MapiFileDesc, FAR *lpMapiFileDesc;
Members
ulReserved
Reserved; must be zero.
flFlags
Bitmask of attachment flags. The following flags can be set:
MAPI_OLE
Indicates the attachment is an OLE object file attachment. If MAPI_OLE_STATIC is also set, the object is static. If neither flag is set, the attachment is simply a data file.
MAPI_OLE_STATIC
Set to iIndicates a static OLE object file attachment.
nPosition
Integer used in the MapiMessage structure member lpszNoteText to indicate at which character the attachment should be rendered in the message body. The application renders an attachment within the message text at the character and offset designated by lpszNoteText[nPosition] in MapiMessage. A value of - 1 (0xFFFFFFFF) means attachment position is not indicated in this way.
lpszPathName
Pointer to the fully qualified path of the attachment file. This path should include the disk drive letter and directory name.
lpszFileName
Optional pointer to the attachment filename seen by the recipient, which may differ from the filename in the lpszPathName member if temporary files are being used. If the lpszFileName member is empty or NULL, the filename from lpszPathName is used.
lpFileType
Optional pointer to a descriptor that can be used to indicate to message recipients the type of the attached file; an example is a filename extension such as .DOC. A value of NULL indicates an unknown or operating system-
determined file type.
---
Quellcode in meinem Programm: [das was da steht hab ich grösstenteils aus ner Delphi Demo kopiert]
procedure TMain.SendBtnClick(Sender: TObject);
var
MapiMessage: TMapiMessage;
MError: Cardinal;
begin
with MapiMessage do
begin
ulReserved := 0;
lpszSubject := nil;
lpszNoteText := nil;
lpszMessageType := nil;
lpszDateReceived := nil;
lpszConversationID := nil;
flFlags := 0;
lpOriginator := nil;
nRecipCount := 0;
lpRecips := nil;
nFileCount := 0;
lpFiles := nil; // Was muss man hier schreiben???
end;
MError := MapiSendMail(0, 0, MapiMessage,
MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0);
if MError <> 0 then Application.MessageBox('Nachrichtenerstellung beendet.','Warnung',48);
end;
---
Kann mir einer Helfen?
thx, mirage228