L
liubin44966
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下<br>IdSMTP1.AuthenticationType:=atLogin;<br> IdSMTP1.Username:=liubin44966@163.com;<br> IdSMTP1.Password:=**********;<br> IdSMTP1.Host:=smtp.163.com;<br> IdSMTP1.Port:=25;<br> try<br> IdSMTP1.Connect;<br> except<br> Application.MessageBox('连接SMTP服务器失败!','提示',MB_OK+MB_ICONEXCLAMATION);<br> Exit;<br> end;<br> try<br> with IdMessage1 do<br> begin<br> clear;<br> body.Clear;<br> Body.Add('上报数据');//内容<br> From.Text:=trim(Ed_yxdz.Text);<br> Recipients.EMailAddresses :=sjr;//收件人<br> Subject:='上报数据';//主题<br> TIdAttachment.Create(IdMessage1.MessageParts,file_name);<br> end;<br>// +++++++++++++++++++++++++++++<br> IdSMTP1.Send(IdMessage1);<br>注意:执行到这产生错误<br><br> Application.MessageBox('邮件发送成功!','提示',MB_OK+MB_ICONASTERISK); <br> finally<br> IdSMTP1.Disconnect;<br> end;<br><br>提示错误<br>bad sequence of commands