Главная страница
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.021 c
14-8119
race1
2002-09-07 09:50
2002.10.03
табличка


6-8079
aglar
2002-07-31 10:49
2002.10.03
Размер скаченной с интернет информации


3-7822
Beginner2
2002-09-12 10:09
2002.10.03
DBGrid+ADOTable


1-7904
AL2002
2002-09-23 14:57
2002.10.03
Кнопочка


4-8214
Soft
2002-08-16 14:04
2002.10.03
Завершился ли Thread или нет?