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

Вниз

Создать письмо   Найти похожие ветки 

 
Jumbo   (2003-07-16 20:29) [0]

Дайте, пожалуйста, пример создания из своей программы письма с вложенным файлом (как это делает, к примеру, MS Internet Explorer).


 
Palladin ©   (2003-07-16 20:47) [1]

в d6 на вкладке servers есть PostItem...
кидай на форму и вперед... изучай методы свойства... ковыряй в общем...
если у тебя не d6 - придется создавать type library


 
Song ©   (2003-07-16 22:04) [2]

MapiSendMail()
см. в FAQ


 
Borman   (2003-07-21 11:54) [3]

uses MAPI

//------------------------------------------------------------------------------
Function SendMail(const From, Dest, Subject, Text, FileName: PChar): Integer;
var
Message: TMapiMessage;
Recipient, Sender: TMapiRecipDesc;
File_Attachment: TMapiFileDesc;

function MakeMessage: TMapiMessage;
begin
FillChar(Sender, SizeOf(Sender), 0);
Sender.ulRecipClass := MAPI_ORIG;
Sender.lpszAddress := From;

FillChar(Recipient, SizeOf(Recipient), 0);
Recipient.ulRecipClass := MAPI_TO;
Recipient.lpszAddress := Dest;

FillChar(File_Attachment, SizeOf(File_Attachment), 0);
File_Attachment.nPosition := ULONG(-1);
File_Attachment.lpszPathName := FileName;

FillChar(Result, SizeOf(Result), 0);
with Message do begin
lpszSubject := Subject;
lpszNoteText := Text;
lpOriginator := @Sender;
nRecipCount := 1;
lpRecips := @Recipient;
nFileCount := 1;
lpFiles := @File_Attachment;
end;
end;

var
SM: TFNMapiSendMail;
MAPIModule: HModule;
begin
MAPIModule := LoadLibrary(PChar(MAPIDLL));
if MAPIModule = 0 then
Result := -1
else
try
@SM := GetProcAddress(MAPIModule, "MAPISendMail");
if @SM <>nil then begin
MakeMessage;
Result := SM(0, 0, Message,MAPI_RECEIPT_REQUESTED {0}, 0);
end else Result := 1;
finally
( MAPIModule)
uses MAPI

//------------------------------------------------------------------------------
Function SendMail(const From, Dest, Subject, Text, FileName: PChar): Integer;
var
Message: TMapiMessage;
Recipient, Sender: TMapiRecipDesc;
File_Attachment: TMapiFileDesc;

function MakeMessage: TMapiMessage;
begin
FillChar(Sender, SizeOf(Sender), 0);
Sender.ulRecipClass := MAPI_ORIG;
Sender.lpszAddress := From;

FillChar(Recipient, SizeOf(Recipient), 0);
Recipient.ulRecipClass := MAPI_TO;
Recipient.lpszAddress := Dest;

FillChar(File_Attachment, SizeOf(File_Attachment), 0);
File_Attachment.nPosition := ULONG(-1);
File_Attachment.lpszPathName := FileName;

FillChar(Result, SizeOf(Result), 0);
with Message do begin
lpszSubject := Subject;
lpszNoteText := Text;
lpOriginator := @Sender;
nRecipCount := 1;
lpRecips := @Recipient;
nFileCount := 1;
lpFiles := @File_Attachment;
end;
end;

var
SM: TFNMapiSendMail;
MAPIModule: HModule;
begin
MAPIModule := LoadLibrary(PChar(MAPIDLL));
if MAPIModule = 0 then
Result := -1
else
try
@SM := GetProcAddress(MAPIModule, "MAPISendMail");
if @SM <>nil then begin
MakeMessage;
Result := SM(0, 0, Message,MAPI_RECEIPT_REQUESTED {0}, 0);
end else Result := 1;
finally
FreeLibrary(MAPIModule);
end;
end;
//------------------------------------------------------------------------------



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

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

Наверх




Память: 0.47 MB
Время: 0.017 c
8-71760
LoMik
2003-05-24 21:57
2003.09.22
Изменить уровень громкости


7-71983
KSergey
2003-07-09 13:26
2003.09.22
Про выключение компьютера и пример из FAQ Подгрецкого


6-71781
test
2003-07-23 18:20
2003.09.22
Как передать по средствам TCP TStringList c клиента на сервер?


3-71549
Alik$
2003-07-30 21:33
2003.09.22
Ошибка при активизации


1-71675
Pavel Oliynik
2003-09-11 11:28
2003.09.22
подстановку label.caption из ресурса по название лейбела