Вниз
Скачать: CL | DM;

Отправка E-Mail a Indy   Найти похожие ветки 

← →
XTD ©   (2006-08-14 16:37) [0]

Мой код:
unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
 IdTCPClient, IdMessageClient, IdSMTP, IdMessage;

type
 TForm1 = class(TForm)
   Button1: TButton;
   IdSMTP1: TIdSMTP;
   IdMessage1: TIdMessage;
   procedure Button1Click(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var Msg: TIdMessage;
begin
IdSMTP1.Port:=25;
IdSMTP1.Host := "smtp.mail.ru";
IdSMTP1.AuthenticationType:=atLogin;
IdSMTP1.Username:="MyLogin@mail.ru";
IdSMTP1.Password:="MyPass";
IdSMTP1.Connect(5000);

Msg.Subject:="Тема сообщения";
Msg.Recipients.EMailAddresses:="delphi@mail.ru";//Получатель
Msg.From.Address:="delphi@mail.ru";//Отправитель
Msg.Body.Text:="Текст сообщения";
Msg.Date:=StrToDate("14.08.2006");//Дата отправки
if IdSMTP1.Connected=True then  IdSMTP1.Send(Msg);

IdSMTP1.Disconnect;
end;

end.

ВЫДАЕТ ОШИБКУ:
... исключение класса EAccessViolation ...

ЧТО ДЕЛАТЬ ???


← →
Сергей М. ©   (2006-08-14 16:44) [1]

Msg := TIdMessage.Create(..); //!!!!!!!!!!!!!!!
Msg.Subject:="Тема сообщения";
...


← →
XTD ©   (2006-08-14 16:46) [2]

Msg := TIdMessage.Create(?????????);


← →
Сергей М. ©   (2006-08-14 16:47) [3]

nil


← →
XTD ©   (2006-08-14 16:54) [4]

... исключение класса EldProtocolReplyError ...
send address must match authenticated user


← →
XTD ©   (2006-08-14 16:56) [5]

Нашел! Спасибо...



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

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



Память: 0.46 MB
Время: 0.025 c
3-1151004540
Krants
2006-06-22 23:29
2006.09.03
Хроника БД Access


4-1147446323
Dstr
2006-05-12 19:05
2006.09.03
Как создать форму в отдельном потоке?


2-1155632879
rym
2006-08-15 13:07
2006.09.03
Глупо


6-1144955552
qazwsx
2006-04-13 23:12
2006.09.03
base64_encode(pack("H*", sha1(utf8_encode($_GET[ pwd ])))))


2-1155276649
Yegorchic
2006-08-11 10:10
2006.09.03
Проблема с удалением папки




   Наверх