M
mafp
Unregistered / Unconfirmed
GUEST, unregistred user!
编一个发邮件的程序,用到idmessage和idsmtp控件,
IdMessage1.Recipients.EMailAddresses := 'eagle@163.com';
idmessage1.From.Text := 'eagle@163.com';
idmessage1.Subject := '测试';
idmessage1.Body.Add('idsmtp和idmessage');
if (smtp.Connected()) then
begin
smtp.Disconnect();
end
else
begin
Smtp.AuthenticationType := atLogin;
SMTP.UserID := 'eagle';
SMTP.Password :='123456';
SMTP.Host := 'smtp.163.com';
SMTP.Port := 25;
SMTP.Connect;
if(smtp.Authenticate()) then
begin
memo1.Lines.Add('登陆服务器验证成功!');
SMTP.Send(IdMessage1);
memo1.Lines.Add('邮件发送成功!')
end;
smtp.Disconnect();
end;
执行到SMTP.Send(IdMessage1);时
提示非法用户,为什么?
IdMessage1.Recipients.EMailAddresses := 'eagle@163.com';
idmessage1.From.Text := 'eagle@163.com';
idmessage1.Subject := '测试';
idmessage1.Body.Add('idsmtp和idmessage');
if (smtp.Connected()) then
begin
smtp.Disconnect();
end
else
begin
Smtp.AuthenticationType := atLogin;
SMTP.UserID := 'eagle';
SMTP.Password :='123456';
SMTP.Host := 'smtp.163.com';
SMTP.Port := 25;
SMTP.Connect;
if(smtp.Authenticate()) then
begin
memo1.Lines.Add('登陆服务器验证成功!');
SMTP.Send(IdMessage1);
memo1.Lines.Add('邮件发送成功!')
end;
smtp.Disconnect();
end;
执行到SMTP.Send(IdMessage1);时
提示非法用户,为什么?