![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Отправка почты [D7, WinXP]
Гиричев Руслан © (2004-02-21 22:21:00)Здравствуйте!
Как отправить писимо, с темой и сообщением?
shellexecute(handle, 'open','mailto:girichevr@yandex.ru',nil,nil,sw_restore);
Что для этого нужно изменить?
Заранее спасибо!
Иван Николаевич Понырев (2004-02-25 09:45:00) [1]with NMSMTP1do
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;
csr (2004-02-22 16:18:00) [2]Я понял тебя комрад:
shellexecute(handle, 'open','mailto:girichevr@yandex.ru?subject=Hello&body=body',nil,nil,sw_shownormal);
Palladin (2004-02-22 00:12:00) [3]Есть. Самый простой. Попросить более опытного товарища сделать это за тебя.
Гиричев Руслан (2004-02-22 00:11:00) [4]Вариантов более нету??
P.N.P. (2004-02-21 23:33:00) [5]
> Гиричев Руслан © (21.02.04 22:46) [2]
Indy
Гиричев Руслан (2004-02-21 22:46:00) [6]Спасибо!
Ух! Можно ли попроще???
P.N.P. (2004-02-21 22:39:00) [7]так например...
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;