Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.09.03;
Скачать: 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 вся ветка

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

Наверх




Память: 0.47 MB
Время: 0.054 c
2-1155559354
UMU
2006-08-14 16:42
2006.09.03
FindDialog


15-1155203084
DmitryS
2006-08-10 13:44
2006.09.03
Дайте совет по написанию трехзвенки


4-1146633463
Виииктариной
2006-05-03 09:17
2006.09.03
Отсылка нажатых кнопок в другую прогу


15-1155461333
Чемульпо
2006-08-13 13:28
2006.09.03
Помогите плиз!


3-1151136746
Karburator
2006-06-24 12:12
2006.09.03
вырубить клиента