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

Вниз

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

 
Гиричев Руслан ©   (2004-02-21 22:21) [0]

Здравствуйте!
Как отправить писимо, с темой и сообщением?
shellexecute(handle, "open","mailto:girichevr@yandex.ru",nil,nil,sw_restore);
Что для этого нужно изменить?
Заранее спасибо!


 
P.N.P. ©   (2004-02-21 22:39) [1]

так например...


uses MAPI

function SendMail(const From, Dest, Subject, Text, FileName: PChar;
Outlook: boolean):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 := Cardinal(-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;
 MAPI_FLAG: Cardinal;
begin
 if Outlook then
  MAPI_FLAG:=MAPI_DIALOG
 else
  MAPI_FLAG:=0;
 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, Application.Handle, Message, MAPI_FLAG, 0);
     end else Result := 1;
   finally
     FreeLibrary(MAPIModule);
   end;
end;


 
Гиричев Руслан ©   (2004-02-21 22:46) [2]

Спасибо!
Ух! Можно ли попроще???


 
P.N.P. ©   (2004-02-21 23:33) [3]


> Гиричев Руслан ©   (21.02.04 22:46) [2]


Indy


 
Гиричев Руслан ©   (2004-02-22 00:11) [4]

Вариантов более нету??


 
Palladin ©   (2004-02-22 00:12) [5]

Есть. Самый простой. Попросить более опытного товарища сделать это за тебя.


 
csr ©   (2004-02-22 16:18) [6]

Я понял тебя комрад:

shellexecute(handle, "open","mailto:girichevr@yandex.ru?subject=Hello&body=body",nil,nil,sw_shownormal);


 
Иван Николаевич Понырев   (2004-02-25 09:45) [7]

with NMSMTP1 do
 begin
   Host := "t.ru";
   UserID := "tt";
   Connect;

   PostMessage.ToAddress.Text := "t@s.ru";
   PostMessage.FromAddress := "null@s.ru";

   PostMessage.Body.Text := "This message was created automatically by mail delivery software."+#10+#13+
""+#10+#13+
"A message that you sent could not be delivered to one or more of its"+#10+#13+
"recipients. This is a permanent error. The following address(es) failed:"+#10+#13+
""+#10+#13+
" v@s.ru"+#10+#13+
"    SMTP error from remote mailer after RCPT TO:<v@s.ru>:"+#10+#13+
"    host s.ru [211.232.247.132]: 550 <v@s.ru>... User unknown";
   PostMessage.Subject := "Mail Soft ";
   SendMail;
   disconnect;
 end;



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

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

Наверх




Память: 0.48 MB
Время: 0.022 c
1-1081421349
kent
2004-04-08 14:49
2004.04.25
передача ссылки на объект


3-1080633337
Innokenty
2004-03-30 11:55
2004.04.25
Умножение или деление. Что быстрее.


1-1081279928
Nevil
2004-04-06 23:32
2004.04.25
Выделенные Items в ListView нарисованные на канвасе


14-1080720175
newone
2004-03-31 12:02
2004.04.25
Help!


14-1081083425
mfender
2004-04-04 16:57
2004.04.25
TaskManager