哦,谢谢这位仁兄提醒!我是要实现简单的email发送功能,可是出现上面那个错误,麻烦帮我看下是那错误
什么意思?源程序如下:
type
TForm1 = class(TForm)
NMSMTP1: TNMSMTP;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
with Nmsmtp1 do
begin
nmsmtp1.Host :='smtp.21cn.com';
nmsmtp1.PostMessage.ToAddress.Add('1997@21cn.com');
nmsmtp1.PostMessage.FromAddress:='2002xx@21cn.com';
nmsmtp1.PostMessage.FromName:='2002xx';
nmsmtp1.PostMessage.Subject :='test';
nmsmtp1.PostMessage.Body.Text :='this is a test!';
nmsmtp1.Connect ;
nmsmtp1.SendMail ;
nmsmtp1.Disconnect ;
end;
end;
end.