unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdMessage, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdMessageClient, IdSMTP;type
TForm1 = class(TForm)
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
IdSMTP1.Username :='aa13580127332'; //服务器上的用户名
IdSMTP1.Password :='aa1988710'; //服务器上的密码
IdSMTP1.Host :='smtp.163.com'; //服务器SMTP地址
IdSMTP1.Port :=25; //服务器端口
IdSMTP1.Connect; //建立连接
end;procedure TForm1.Button1Click(Sender: TObject);
begin
IdMessage1.Body.Add( ' 呵呵,感谢Edwgdfsgfdgdsdsfgdsfdfgddfgdfdgf@rd吧' );
//邮件正文件内容
IdMessage1.From.address :='[email protected]'; //发件人地址
IdMessage1.Recipients.EMailAddresses :='[email protected]'; //收件人地址,这里改为你的EMAIL地址
IdMessage1.Subject:='发送邮件就这么简单' ; //邮件标题
IdMessage1.Priority := mphigh; //优先级,mphigh为最高级。
IdSMTP1.Send(IdMessage1); //发送邮件
end;end.照足网上的做但还是没有发送成功!求解。错误为:
----------------------------------------------------------------------------------
project project2.exe raised exception class eidprotocolreplyerror with message
'authentication is required.smtp14,escowkdlk3hx6nhm49olaq---829s3 1289283673
process stopped.use step or run to continue.
ok help
------------------------------------------------------------------------------
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdMessage, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdMessageClient, IdSMTP;type
TForm1 = class(TForm)
IdSMTP1: TIdSMTP;
IdMessage1: TIdMessage;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
IdSMTP1.Username :='aa13580127332'; //服务器上的用户名
IdSMTP1.Password :='aa1988710'; //服务器上的密码
IdSMTP1.Host :='smtp.163.com'; //服务器SMTP地址
IdSMTP1.Port :=25; //服务器端口
IdSMTP1.Connect; //建立连接
end;procedure TForm1.Button1Click(Sender: TObject);
begin
IdMessage1.Body.Add( ' 呵呵,感谢Edwgdfsgfdgdsdsfgdsfdfgddfgdfdgf@rd吧' );
//邮件正文件内容
IdMessage1.From.address :='[email protected]'; //发件人地址
IdMessage1.Recipients.EMailAddresses :='[email protected]'; //收件人地址,这里改为你的EMAIL地址
IdMessage1.Subject:='发送邮件就这么简单' ; //邮件标题
IdMessage1.Priority := mphigh; //优先级,mphigh为最高级。
IdSMTP1.Send(IdMessage1); //发送邮件
end;end.照足网上的做但还是没有发送成功!求解。错误为:
----------------------------------------------------------------------------------
project project2.exe raised exception class eidprotocolreplyerror with message
'authentication is required.smtp14,escowkdlk3hx6nhm49olaq---829s3 1289283673
process stopped.use step or run to continue.
ok help
------------------------------------------------------------------------------
解决方案 »
- 我有一INI文件用于 TreeView 目录保存和读取,现想进行加密,紧急求助!
- delphi做的客户端怎样访问BES上的webservice?
- 为什么呀为什么?老出现EAccessViolation异常。50分送给主要解答人
- 有没有好的delphi doc生成工具要能支持中文的
- 请问重建桌面图标缓存是如何实现的?
- 关于richedit的,请高手帮我...
- 大家认为这里哪些Delphi书比较好 http://www.china-pub.com/search/quickly_search_pro.asp?chubanshe=&key=delphi&name=Delphi
- 请问哪位高手能作frontpage的ole
- 誰有Delphi By delphi的代碼
- 程序不能用?
- delphi调用c++的dll库
- DynamicSkinForm 5.90 这个控件怎么用呢?
IdSMTP1.UseEHLO := true
var
srv: TIdSMTP;
msg: TIdMessage;
begin
srv := TIdSMTP.Create(nil);
msg := TIdMessage.Create(nil);
with srv do
begin
AuthenticationType := atLogin;
Username := '****@11111.com'; //**邮件发送用户名
Password := 'test'; //**邮件发送用户密码
Host := 'mail.11111.com'; //**邮件服务器
Port := 25;
with msg do
begin
Clear;
From.Address := '*****@1111.com'; //**发件人邮件地址
From.Name := 'test'; //**发件人名字
Recipients.EMailAddresses := MailAddress;
Subject := MailSubject;
Body.Add(MailBody);
end;
try
begin
Connect();
Send(msg);
Disconnect;
end;
except on E:Exception do
begin
ShowMessage(E.Message);
Disconnect;
Result := False;
Abort;
Exit;
end;
end;
end;
Result := True;
end;