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

Вниз

Отправка email, глючит ;(   Найти похожие ветки 

 
BlackSun   (2002-08-02 15:01) [0]

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

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.


 
BlackSun   (2002-08-02 16:34) [1]

Может кто-нибудь кинет точно работающий код отсылки письма. Я у себя попробую, если не получится, то придется копаться в системе.



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

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

Наверх




Память: 0.47 MB
Время: 0.016 c
1-8033
Mazenrat
2002-09-20 15:18
2002.10.03
Активен ли таймер (SetTimer)?


1-7923
Akim2
2002-09-23 11:11
2002.10.03
Помогите вычитать адрес сетевой платы.


1-7933
alexsandri
2002-09-23 19:40
2002.10.03
мужики тая прблема парунедель назад пришло письмо


6-8103
ga3
2002-08-01 04:07
2002.10.03
насчет конфигурации IE


3-7852
Guardian
2002-09-11 13:50
2002.10.03
Не передаются параметры в функцию dbiAddIndex