H
hrp123
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TfrmMain.Button2Click(Sender: TObject);
begin
//需验证的邮箱
If chbLogin.Checked then
begin
idsmtp1.Authen
ticationType := atLogin;
idsmtp1.UserName := edtUserName.Text;
idsmtp1.PassWord := edtPassWord.Text;
End else
idsmtp1.Authen
ticationType := atNone;
idsmtp1.Host := 'smtp.163.com';
idsmtp1.Port := 25;
idsmtp1.Connect;
try
IdMessage1.From.Name := edtFrom.Text;
//发件地址
IdMessage1.Recipients.EMailAddresses := edtTo.Text;
//收件邮箱
IdMessage1.Subject := edtSubject.Text;
IdMessage1.Body.Assign(mmContent.Lines);
try
idsmtp1.Send(IdMessage1);
showMessage('OK');
Except
showmessage('Failure');
end;
Finally
idsmtp1.Disconnect;
end;
end;
为什么提示发送失败,调试时错误提示是:bad sequence of Command.不知哪里出错?
begin
//需验证的邮箱
If chbLogin.Checked then
begin
idsmtp1.Authen
ticationType := atLogin;
idsmtp1.UserName := edtUserName.Text;
idsmtp1.PassWord := edtPassWord.Text;
End else
idsmtp1.Authen
ticationType := atNone;
idsmtp1.Host := 'smtp.163.com';
idsmtp1.Port := 25;
idsmtp1.Connect;
try
IdMessage1.From.Name := edtFrom.Text;
//发件地址
IdMessage1.Recipients.EMailAddresses := edtTo.Text;
//收件邮箱
IdMessage1.Subject := edtSubject.Text;
IdMessage1.Body.Assign(mmContent.Lines);
try
idsmtp1.Send(IdMessage1);
showMessage('OK');
Except
showmessage('Failure');
end;
Finally
idsmtp1.Disconnect;
end;
end;
为什么提示发送失败,调试时错误提示是:bad sequence of Command.不知哪里出错?