J
jgame
Unregistered / Unconfirmed
GUEST, unregistred user!
idsmtp1.Send(idmessage1);这里出错了...提示<br>Bad sequence of commands <br>这段简单的代码..我检查的晕了..谁知道是哪里出问题了...<br>***大家用自己的账号换下..<br>///////////////////////////////////////////<br><br>idmessage1.From.Text:='***@126.com';<br>idmessage1.Sender.Text:='***@126.com';<br>idmessage1.Recipients.EMailAddresses:='***@@sina.com';<br>idmessage1.Subject:='aaaaaaaaaaaaaaaaaa';<br>idmessage1.Body.Text:='bbbbbbbbbbb';<br><br>idsmtp1.AuthenticationType:=atLogin;<br>IdSMTP1.Username:='***';<br>IdSMTP1.Password:='***';<br>IdSMTP1.Host:='smtp.126.com';<br>IdSMTP1.Port:=25;<br><br>try<br> IdSMTP1.Connect(1000);<br>except<br> form1.Caption:='连接失败';<br>end;<br><br>if idsmtp1.Connected then<br>BEGIN<br><br>form1.Caption:='连接成功';<br>try<br> idsmtp1.Send(idmessage1);<br>except<br> form1.Caption:=form1.Caption+'发送失败';<br>end;<br>END;