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

Вниз

Как послать e-mail, чтобы пользователь даже не знал об этом?   Найти похожие ветки 

 
Delphimun ©   (2002-01-06 09:51) [0]

Как послать e-mail, чтобы пользователь даже не знал об этом(с вложенным файлом)!

Когда я компилирую данный код он выдаёт ошибки.
Вот код модуля программы:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;

type
TForm1 = class(TForm)
function SendEmail(const RecipName, RecipAddress, Subject, Attachment: string): Boolean;

function IsOnline: Boolean;


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
ulRecerved:= 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;


function IsOnline: Boolean;
var
RASConn: TRASConn;
dwSize,dwCount: DWORD;
begin
RASConns.dwSize:= SizeOf(TRASConn);
dwSize:= SizeOf(RASConns);
Res:=RASEnumConnectionsA(@RASConns, @dwSize, @dwCount);
Result:= (Res = 0) and (dwCount > 0);
end;

end.

При компиляции выдаёт ошибки:
Unit.pas(30): Undeclared indentifier: "TMapiMessage"
Unit.pas(31): Undeclared indentifier: "TMapiFileDesc"
Unit.pas(32): Undeclared indentifier: "TmapiRecipDesc"
Unit.pas(37): Undeclared indentifier: "ulrecerved"
Unit.pas(38): Undeclared indentifier: "ulRecipClass"
Unit.pas(38): Undeclared indentifier: "MAPI_TO"
Unit.pas(39): Undeclared indentifier: "IpszName"
Unit.pas(40): Undeclared indentifier: "IpszAdress"
Unit.pas(41): Undeclared indentifier: "uieidsize"
Unit.pas(42): Undeclared indentifier: "IpEntyID"
Unit.pas(46): Undeclared indentifier: "ulReserved"
Unit.pas(47): Undeclared indentifier: "flFlags"
Unit.pas(48): Undeclared indentifier: "nPosition"
[Error] Unit1.pas(49): Undeclared identifier: "lpszPathName"
[Error] Unit1.pas(50): Undeclared identifier: "lpszFileName"
[Error] Unit1.pas(51): Undeclared identifier: "lpFileType"
[Error] Unit1.pas(56): Undeclared identifier: "lpszSubject"
[Error] Unit1.pas(57): Undeclared identifier: "lpszNoteText"
[Error] Unit1.pas(58): Undeclared identifier: "lpszMessageType"
[Error] Unit1.pas(59): Undeclared identifier: "lpszDateReceived"
[Error] Unit1.pas(60): Undeclared identifier: "lpszConversationID"
[Error] Unit1.pas(62): Undeclared identifier: "lpOriginator"
[Error] Unit1.pas(63): Undeclared identifier: "nRecipCount"
[Error] Unit1.pas(64): Undeclared identifier: "lpRecips"
[Error] Unit1.pas(66): Undeclared identifier: "nFileCount"
[Error] Unit1.pas(67): Undeclared identifier: "lpFiles"
[Error] Unit1.pas(74): Undeclared identifier: "MapiSendMail"
[Error] Unit1.pas(74): Undeclared identifier: "MAPI_DIALOG"
[Error] Unit1.pas(75): Undeclared identifier: "MAPI_LOGON_UI"
[Warning] Unit1.pas(75): Combining signed and unsigned types - widened both operands

[Error] Unit1.pas(75): Undeclared identifier: "SUCCESS_SUCCESS"
[Warning] Unit1.pas(75): Comparing signed and unsigned types - widened both operands
[Error] Unit1.pas(81): Undeclared identifier: "TRASConn"
[Error] Unit1.pas(84): Undeclared identifier: "RASConns"
[Error] Unit1.pas(86): Undeclared identifier: "Res"
[Warning] Unit1.pas(87): Comparing signed and unsigned types - widened both operands
[Error] Unit1.pas(13): Unsatisfied forward or external declaration: "TForm1.IsOnline"
[Fatal Error] Project1.dpr(5): Could not compile used unit "Unit1.pas"

Как мне исправить ошибки и отослать письмо с вложенным в него файлом?



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

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

Наверх




Память: 0.47 MB
Время: 0.014 c
4-90706
Death
2001-12-27 02:02
2002.02.28
XPDesign


3-90485
Seri
2002-02-04 10:59
2002.02.28
Что будет после переоткрытия?


4-90705
cher_gvf
2001-12-03 17:33
2002.02.28
Как послать сообщение по сети определенным юзерам?


3-90512
tow
2002-02-04 10:50
2002.02.28
Базы данных


7-90685
REL
2001-11-22 18:49
2002.02.28
AT команды