Главная страница
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.012 c
3-7780
Mike Pr
2002-09-14 22:11
2002.10.03
Два вопроса


3-7856
KIR
2002-09-12 08:43
2002.10.03
2 запроса в один DBGrid


3-7841
Aristarh
2002-09-10 17:20
2002.10.03
2NickBat: CM-это не Championship Manager?


14-8124
Delirium
2002-09-08 14:01
2002.10.03
Новейший QuickReport 3.6.2 Professional + Exports 2


3-7794
sirota
2002-09-11 15:18
2002.10.03
Задолбали глюки :((((