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

Хелп, отсылка письма...   Найти похожие ветки 

← →
BlackSun   (2002-08-03 02:23) [0]

Использую нижеприведенный код, но ничего не отсылается ;( Просто звук какой-то издается и все... в чем проблема? Ну очень надо.
Может кто-нибудь кинет точно работающий код отсылки письма? Я у себя попробую, если не получится, то придется копаться в системе.
Нужно именно на API.

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,mapi,
StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}
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
ulReserved:= 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;

procedure TForm1.Button1Click(Sender: TObject);
begin
sendemail("MyName","mymail@mail.ru","subject","");
end;

end.


-----------------------------------------------------------------


← →
Schummi ©   (2002-08-03 07:45) [1]

Попробуй посылвть запрос серверу на PHP документ. А ПХП документ этот пускай и отсылает - такой вариант тебе подойдет больше всего!


← →
Schummi ©   (2002-08-10 08:13) [2]

Или посмотри http://delphi.mastak.ru/cgi-bin/forum.pl?look=1&id=1016951934&n=4 Наверняка что-то там найдешь для себя!



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

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



Память: 0.45 MB
Время: 0.01 c
6-71276
Big Lamer
2002-06-09 00:34
2002.08.22
Как организовать прием-посылку Popup-сообщений ?


3-71063
X-jedy
2002-08-01 13:40
2002.08.22
параметры в ADOQuery :(


3-70957
dimonf
2002-08-04 12:51
2002.08.22
Подскажите почему у меня не работает база данных под Windows XP?


1-71110
kull
2002-08-12 18:58
2002.08.22
Перхват вызова функций DLL?


14-71330
Феликс
2002-07-26 13:36
2002.08.22
На землю налетили уроды, которые портят форум своими темами!




   Наверх