Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Потрепаться";
Текущий архив: 2002.02.28;
Скачать: [xml.tar.bz2];

Вниз

Как послать 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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.003 c
3-90504
Woron
2002-02-03 22:51
2002.02.28
ошибка при UPDATE


4-90723
Ryder VII
2001-12-28 23:11
2002.02.28
Что такое виндовый таймер?


14-90640
Knight
2002-01-12 13:22
2002.02.28
Глюки Винды не толькоменя наверное достали но и остальных пользователей Вин98...


14-90633
Mz
2002-01-08 10:53
2002.02.28
подмена заголовка IP пакета


3-90517
nata1
2002-02-01 11:43
2002.02.28
Вопрос по QReport





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский