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

Вниз

Отправка письма с помощью SendMail   Найти похожие ветки 

 
seregin2   (2004-07-22 09:41) [0]

Всем привет! Сегодня в рассылке был пример отправки письма посредством SendMail. Я похожий код мучил недели 2 назад - так и не разобрался как отправить во вложении НЕСКОЛЬКО файлов, и как отправить письмо сразу НЕСКОЛЬКИМ получателям?
на самом деле, функции передается не адрес получателя, а массив адресов, но корректно описать его я не смог.


 
REA ©   (2004-07-22 09:54) [1]

код давай


 
seregin2   (2004-07-22 10:18) [2]

function SendEmail(const RecipName, RecipAddress, Subject, Attachment: string): Boolean;
var  MapiMessage: TMapiMessage;  
 MapiFileDesc: TMapiFileDesc;  
 MapiRecipDesc: TMapiRecipDesc;  
 i: integer;  
 s: string;
begin  
 with MapiRecipDesc do begin
   ulRecerved:= 0;
   ulRecipClass:= MAPI_TO;
   lpszName:= PChar(RecipName);
   lpszAddress:= PChar(RecipAddress);
   ulEIDSize:= 0;
   lpEntryID:= nil;
 end;
 with MapiFileDesc do begin      
   ulReserved:= 0;      
   flFlags:= 0;      
   nPosition:= 0;      
   lpszPathName:= PChar(Attachment);      
   lpszFileName:= nil;      
   lpFileType:= nil;  
 end;  
 with MapiMessage do begin      
   ulReserved := 0;      
   lpszSubject := nil;      
   lpszNoteText := PChar(Subject);      
   lpszMessageType := nil;      
   lpszDateReceived := nil;      
   lpszConversationID := nil;      
   flFlags := 0;      
   lpOriginator := nil;      
   nRecipCount := 1;      
   lpRecips := @MapiRecipDesc;      
   if length(Attachment) > 0 then begin          
     nFileCount:= 1;          
     lpFiles := @MapiFileDesc;      
   end else begin          
     nFileCount:= 0;          
     lpFiles:= nil;      
   end;    
 end;  
 Result:= MapiSendMail(0, 0, MapiMessage, MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0) = SUCCESS_SUCCESS;
end;



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

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

Наверх




Память: 0.47 MB
Время: 0.023 c
1-1090503794
Artoshka
2004-07-22 17:43
2004.08.08
FLASHH.scr


3-1089719178
denis24
2004-07-13 15:46
2004.08.08
adotable1.FieldByName( fl_prov ).Asboolean


14-1082821552
VEG
2004-04-24 19:45
2004.08.08
OGG


3-1089812407
qwer
2004-07-14 17:40
2004.08.08
округление и sql


14-1090495921
ИМХО
2004-07-22 15:32
2004.08.08
Пару слов о Delphi 8