Можно попробовать через MAPI:
#include <mapi.hpp>
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TMapiMessage MapiMessage;
TMapiRecipDesc SenderDesc;
TMapiRecipDesc RecipDesc;
TMapiFileDesc Files;
memset((void*)&SenderDesc,'\0',sizeof(SenderDesc));
SenderDesc.ulRecipClass = MAPI_ORIG;
RecipDesc.ulReserved = 0;
RecipDesc.ulRecipClass = MAPI_TO;
RecipDesc.lpszName ="Test";
RecipDesc.lpszAddress ="SMTP:a@b.c";
RecipDesc.ulEIDSize = 0;
RecipDesc.lpEntryID = NULL;
Files.ulReserved = 0;
Files.flFlags = 0;
Files.nPosition = -1;
Files.lpszPathName ="c:\\autoexec.bat";
Files.lpszFileName ="autoexec.bat";
Files.lpFileType = NULL;
MapiMessage.ulReserved = 0;
MapiMessage.lpszSubject = "Subject";
MapiMessage.lpszNoteText = "NoteText";
MapiMessage.lpszMessageType = NULL;
MapiMessage.lpszDateReceived = NULL;
MapiMessage.lpszConversationID = NULL;
MapiMessage.flFlags = 0;
MapiMessage.lpOriginator = &SenderDesc;
MapiMessage.nRecipCount = 1;
MapiMessage.lpRecips = &RecipDesc;
MapiMessage.nFileCount = 1;
MapiMessage.lpFiles = &Files;
MapiSendMail(0, (ULONG)Application->Handle, MapiMessage,
MAPI_DIALOG | MAPI_LOGON_UI | MAPI_NEW_SESSION, 0);
}
Andrej Kalinicenko
Предыдущий вопрос
|
|
Следующий вопрос
источник
by jenyok
|