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控件更好)
解决方案 »
- dephi连接access,修改功能代码?
- 如何取listview中的内容?
- 打印高手请进来看一下,有关Printer.Canvas.TextOut打印出错,不知道错在哪里?分不够我可以加!
- excel的問題,還請指教
- 我想搜索指定目录中的文件,遍历这个目录中的所有文件....
- 用OLE Provider for ODBC dirvers 连接odbc出错!
- 50分求一个数据库的设计????
- 各位高手,谁对nil有研究,请教isnull()的用法
- 请问Delphi窑洞怎么不见了
- 无聊,散分。
- 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啊,但上面的提示却是...