Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.01 c
14-8169
-Nikita-
2002-09-10 01:45
2002.10.03
Восьмерка или семерка?


1-7931
Осирис
2002-09-20 16:20
2002.10.03
ExtractAssociatedIcon


4-8233
Lamer86
2002-08-16 11:07
2002.10.03
Как убрать программу с Toolbar


1-7947
liho26
2002-09-24 06:52
2002.10.03
Kylix and Linux


1-8011
AndreyS
2002-09-20 14:39
2002.10.03
3D примитивный компонент




   Наверх