Вниз
Скачать: 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.45 MB
Время: 0.026 c
1-1153478918
REA
2006-07-21 14:48
2006.09.03
Image List Alpha Channel


15-1155200212
Slym
2006-08-10 12:56
2006.09.03
Помогите найти статью на тему Интернета и Эл.почты


15-1155394031
serko
2006-08-12 18:47
2006.09.03
QReport в Delphi 7!


15-1154899987
Andy BitOff
2006-08-07 01:33
2006.09.03
TRegExpr by Andrey V. Sorokin. Это далеко не лучший выбор.


15-1155111146
vajo
2006-08-09 12:12
2006.09.03
Как сохранить картинку с сайта?




   Наверх