unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Psock, NMsmtp, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
NMSMTP1: TNMSMTP;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
begin
//设置SMTP服务器地址、端口
NMSMTP1.Host:='smtp.263.com';
NMSMTP1.UserID:='hy';
NMSMTP1.Port:=25;
if NMSMTP1.Connect then
ShowMessage('连接成功!');
else
ShowMessage('连接失败!');
end;
end;end.测试运行时老是出现提示这句出错:
NMSMTP1.Connect此条语句执行后返回的值有两个:true或false,我看来看去的,语法上应该没错啊,但运行时就是出错,还望大家给指点一二,多谢了。测试环境:win sp sp2+delphi5(特意用D5,因为已经自带了NMSMTP控件,虽然D7上的Indy控件更好)
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Psock, NMsmtp, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
NMSMTP1: TNMSMTP;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
begin
//设置SMTP服务器地址、端口
NMSMTP1.Host:='smtp.263.com';
NMSMTP1.UserID:='hy';
NMSMTP1.Port:=25;
if NMSMTP1.Connect then
ShowMessage('连接成功!');
else
ShowMessage('连接失败!');
end;
end;end.测试运行时老是出现提示这句出错:
NMSMTP1.Connect此条语句执行后返回的值有两个:true或false,我看来看去的,语法上应该没错啊,但运行时就是出错,还望大家给指点一二,多谢了。测试环境:win sp sp2+delphi5(特意用D5,因为已经自带了NMSMTP控件,虽然D7上的Indy控件更好)
解决方案 »
- 摘要算法
- delphi调用c语言dll 帮忙帮我调用一下ip
- 树形编号的问题,多谢啊!!!!!!!!!!!!
- File not found: 'frxClass.dcu'
- 哪位大侠用过TRzGroup请进来看看,谢谢!
- 关于声卡
- 佳能相机的SDK
- 请问如何实现当鼠标在listview的item移动时,鼠标换个形状,移出该item时鼠标返回原来形状
- 在线急救!!我将数百条纪录分屏显示,一次显示10条(用10个Label显示),但是我要随机删除某一条纪录并且保证Label显示上也要删除,后来的要随
- 急!急!急!关于BMP文件处理的问题(有难度)
- ttable不 能设置active属性
- 调用AdjustTokenPrivileges函数,出现错误,请高手解决
begin
//设置SMTP服务器地址、端口
NMSMTP1.Host:='smtp.263.com';
NMSMTP1.UserID:='hy';
NMSMTP1.Port:=25;
NMSMTP1.Connect;
if NMSMTP1.Connect then
ShowMessage('连接成功!');
else
ShowMessage('连接失败!');
end;
end;
code]
Type of expression must be BOOLEAN这是怎么回事,我记的NMSMTP1.Connect执行后的值应该是true或false啊,但上面的提示却是...