大家帮助我好吗....好急.........
with IdMsgSend do
begin
From.Address :='zhzyhm@163.com'; //发件人地址
Recipients.EMailAddresses := 'zhzyhm@163.com'; //收件人地址
Subject := 'df'; //邮件主题
Body.Assign(Memo1.Lines); //邮件正文
end;
try
IdSMTP1.Host:='smtp.163.com';
//StatusBar1.SimpleText:='正在连接服务器';
IdSMTP1.Connect();
except
ShowMessage('连接邮件服务器失败!');
// StatusBar1.SimpleText:='连接服务器失败';
abort;
end;
try
with IdSMTP1 do
begin
IdSMTP1.Port:=25;
IdSMTP1.AuthenticationType :=atLogin;
IdSMTP1.Username:='zhzyhm@163.com';
IdSMTP1.Password:='z3z3y60809';
// StatusBar1.SimpleText:='正在发送邮件';
Send(IdMsgSend);
ShowMessage('发送完毕');
end;
finally
IdSMTP1.Disconnect; //断开服务器连接
end;
提示:
Bad sequence of commands
请问怎么办