Вниз
Скачать: CL | DM;

Отправка почты по IMAP.   Найти похожие ветки 

← →
Смертник ©   (2004-08-31 05:30) [0]

Если кто сталкивался с отправкой почты по IMAP, объясните как это делается. Желательно примерчиком, кому не трудно.


← →
Hel   (2004-09-02 11:24) [1]

Если речь идет про MAPI, то вот кусочек проги по отправки мыла:
function SendMailMAPI(const Subject, Body, FileName, SenderName, SenderEMail,
                 RecepientName, RecepientEMail: String) : Integer;
var
 message: TMapiMessage;
 lpSender,
 lpRecepient: TMapiRecipDesc;
 FileAttach: TMapiFileDesc;
 SM: TFNMapiSendMail;
 MAPIModule: HModule;
begin
 FillChar(message, SizeOf(message), 0);
 with message do
 begin
   if (Subject<>"") then
   begin
     lpszSubject := PChar(Subject)
   end;
   if (Body<>"") then
   begin
     lpszNoteText := PChar(Body)
   end;
   if (SenderEMail<>"") then
   begin
     lpSender.ulRecipClass := MAPI_ORIG;
     if (SenderName="") then
     begin
       lpSender.lpszName := PChar(SenderEMail)
     end
     else
     begin
       lpSender.lpszName := PChar(SenderName)
     end;
     lpSender.lpszAddress := PChar("SMTP:"+SenderEMail);
     lpSender.ulReserved := 0;
     lpSender.ulEIDSize := 0;
     lpSender.lpEntryID := nil;
     lpOriginator := @lpSender;
   end;
   if (RecepientEMail<>"") then
   begin
     lpRecepient.ulRecipClass := MAPI_TO;
     if (RecepientName="") then
     begin
       lpRecepient.lpszName := PChar(RecepientEMail)
     end
     else
     begin
       lpRecepient.lpszName := PChar(RecepientName)
     end;
     lpRecepient.lpszAddress := PChar("SMTP:"+RecepientEMail);
     lpRecepient.ulReserved := 0;
     lpRecepient.ulEIDSize := 0;
     lpRecepient.lpEntryID := nil;
     nRecipCount := 1;
     lpRecips := @lpRecepient;
   end
   else
   begin
     lpRecips := nil
   end;
   if (FileName="") then
   begin
     nFileCount := 0;
     lpFiles := nil;
   end
   else
   begin
     FillChar(FileAttach, SizeOf(FileAttach), 0);
     FileAttach.nPosition := Cardinal($FFFFFFFF);
     FileAttach.lpszPathName := PChar(FileName);
     nFileCount := 1;
     lpFiles := @FileAttach;
   end;
 end;
 MAPIModule := LoadLibrary(PChar(MAPIDLL));
 if MAPIModule=0 then
 begin
   Result := -1
 end
 else
 begin
   try
     @SM := GetProcAddress(MAPIModule, "MAPISendMail");
     if @SM<>nil then
     begin
       Result := SM(0, Application.Handle, message, MAPI_LOGON_UI, 0);
       //SM(0, Application.Handle, message, MAPI_SENT, 0);
     end
     else
     begin
       Result := 1
     end;

   finally
     FreeLibrary(MAPIModule);
   end;
 end;
 if Result<>0 then
 begin
   MessageDlg("Error sending mail ("+IntToStr(Result)+").", mtError, [mbOk],
              0)
 end;
end;


← →
Смертник ©   (2004-09-06 06:44) [2]

Нет... Именно IMAP, а не MAPI. По MAPI куча примеров, а по IMAP нет... :))


← →
Unax ©   (2004-09-07 00:39) [3]

Вообще-то по IMAP получают, а не отправляют почту.



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

Скачать: CL | DM;



Память: 0.46 MB
Время: -0.976 c
14-1098465723
Кириешки
2004-10-22 21:22
2004.11.14
From SPYWARE to WARNING.


1-1098600206
Vatik
2004-10-24 10:43
2004.11.14
Геометрические построения


14-1098451206
VID
2004-10-22 17:20
2004.11.14
Генеральный поиск квартиры :)


8-1092337630
Neo_vr
2004-08-12 23:07
2004.11.14
Как отловить на входе аудяхи звук частотой 500 Гц ????


14-1098881227
Snip
2004-10-27 16:47
2004.11.14
Права в NTFS




   Наверх