急,用INDY写邮件发送,总是提示错误,why?(0分)

  • 主题发起人 主题发起人 369369
  • 开始时间 开始时间
3

369369

Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
StatusMemo.Clear;
//setup SMTP
SMTP.Host := ledHost.Text;
SMTP.Port := 25;
//setup mail message
MailMessage.From.Address := ledFrom.Text;
MailMessage.Recipients.EMailAddresses := ledTo.Text + ',' + ledCC.Text;
MailMessage.Subject := ledSubject.Text;
MailMessage.Body.Text := Body.Text;
if FileExists(ledAttachment.Text) then
TIdAttachment.Create(MailMessage.MessageParts, ledAttachment.Text);
//send mail
try
try
SMTP.Connect(1000);
SMTP.Send(MailMessage);
except on E:Exceptiondo
StatusMemo.Lines.Insert(0, 'ERROR: ' + E.Message);
end;
finally
if SMTP.Connected then
SMTP.Disconnect;
end;

错误提示如下:Eidprotocloreplyerror with message 'host denies relay(eyou mta)'
 
后退
顶部