Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.01.29;
Скачать: CL | DM;

Вниз

Отправка электронной почты   Найти похожие ветки 

 
Максим   (2005-10-21 12:55) [0]

Помогите!!! Как программно осуществить отправку электронной почты (The Bat), с вложение.


 
clickmaker ©   (2005-10-21 12:58) [1]

MAPISendMail


 
Максим   (2005-10-21 12:59) [2]

ОК! Спасибо! можно пример, желательно рабочий


 
clickmaker ©   (2005-10-21 13:03) [3]

Вот на Си. На паскаль сам переводи

HINSTANCE HInst = LoadLibrary("mapi32.dll");

LPMAPISENDMAIL MapiSendMail = (LPMAPISENDMAIL)GetProcAddress(HInst, "MAPISendMail");

MapiMessage MapiMessage;
MapiRecipDesc SenderDesc;
MapiRecipDesc RecipDesc;
MapiFileDesc  Files;
ULONG HResult;

memset(&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 = 0;

Files.ulReserved = 0;
Files.flFlags = 0;
Files.nPosition = -1;
Files.lpszPathName = "c:\\BOOT.INI";
Files.lpszFileName = "BOOT.INI";
Files.lpFileType = NULL;

MapiMessage.ulReserved = 0;
MapiMessage.lpszSubject = "Subject";
MapiMessage.lpszNoteText = "This text will \r\nappear";
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;

HResult =(*MapiSendMail)(0, (ULONG)Application->Handle, &MapiMessage,
             MAPI_DIALOG | MAPI_LOGON_UI | MAPI_NEW_SESSION, 0);

FreeLibrary(HInst);


 
wp2   (2005-10-22 23:50) [4]

Ага, а попробуйте без mapi32.dll, а только с помощью Winsock.dll



Страницы: 1 вся ветка

Текущий архив: 2006.01.29;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.034 c
2-1137080568
Дева
2006-01-12 18:42
2006.01.29
нетипизированный файл и процедура BlockRead


15-1136880956
element
2006-01-10 11:15
2006.01.29
HELP PLIZ


9-1124442252
Sos
2005-08-19 13:04
2006.01.29
progresbar


15-1136901397
psa247
2006-01-10 16:56
2006.01.29
Драйвер FileMon !


15-1135593524
psa247
2005-12-26 13:38
2006.01.29
Error open *.dfm !