Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.11.14;
Скачать: 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 вся ветка

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

Наверх




Память: 0.47 MB
Время: 0.038 c
3-1098019361
ILUHA
2004-10-17 17:22
2004.11.14
Помогите с IBDatabase


14-1098444056
S_C
2004-10-22 15:20
2004.11.14
Секурный ввод.


14-1098668960
Думкин
2004-10-25 05:49
2004.11.14
С днем рождения! 25 октября


14-1098964364
SeVTov
2004-10-28 15:52
2004.11.14
Delphi глючит


14-1098805111
Сергей__С
2004-10-26 19:38
2004.11.14
Инсталятор