我得到的错误“SMTP传入数据超时”当我尝试在Windows XP内嵌图像发送一封电子邮件,我使用的是印10的Tiburon的分支下面的代码发送带有内嵌图片的邮件:

   MB := TIdMessageBuilderHtml.Create;
    try
      MB.PlainText.Assign(Text);
      MB.Html.Assign(FHTML);
      MB.HtmlFiles.Add('c:\Path\to\My\Image.jpg');
      MB.FillMessage(IdMessage);
    finally
      MB.Free;
    end;


  if not IdSMTP.Connected then
    IdSMTP.Connect;
  IdSMTP.Send(IdMessage);

这只是发生在Windows XP,Windows Vista中的电子邮件和内嵌图像发送就好了。

显然,它不发送任何内容到服务器,它似乎被卡住发送之前enconding图像。

下面是调用堆栈:

 IdReplySMTP        497   +1 TIdReplySMTP.RaiseReplyError
 IdTCPConnection    574   +1 TIdTCPConnection.RaiseExceptionForLastCmdResult
 IdTCPConnection    724  +10 TIdTCPConnection.CheckResponse
 IdTCPConnection    563   +2 TIdTCPConnection.GetResponse
 IdTCPConnection    583   +4 TIdTCPConnection.SendCmd
 IdTCPConnection    696   +4 TIdTCPConnection.SendCmd
 IdSMTP             377   +2 TIdSMTP.DisconnectNotifyPeer
 IdTCPConnection    517   +5 TIdTCPConnection.Disconnect
 IdSMTP             476   +2 TIdSMTP.Disconnect
 IdTCPConnection    828   +2 TIdTCPConnection.Disconnect
 Email              130  +11 TEmail.Destroy
 System            9806   +1 TObject.Free
 EnviarEmail        322  +38 TFormEnviarEmail.Enviar
 System           12106  +38 @HandleFinally
                             RtlUnwind
 System           11589  +83 @HandleAnyException
                             KiUserExceptionDispatcher
                             RtlAppendUnicodeToString
 IdMessageClient    873   +4 EncodeAttachment
 IdMessageClient   1213 +252 TIdMessageClient.SendBody
 IdMessageClient   1244 +283 TIdMessageClient.SendBody
 IdMessageClient   1269  +12 TIdMessageClient.SendMsg
 IdSMTPBase         251   +6 TIdSMTPBase.SendNoPipelining
 IdSMTPBase         436   +4 TIdSMTPBase.InternalSend
 IdSMTPBase         457   +1 TIdSMTPBase.Send
 IdSMTP             415   +6 TIdSMTP.Send
 IdSMTPBase         449   +6 TIdSMTPBase.Send

什么原因造成的,我怎么能解决这个问题任何线索?

感谢。

有帮助吗?

解决方案 3

问题解决了。

我解析HTML文件来加载图像,并在电子邮件中附上他们,但在Windows XP中的路径是:

C:\Documents And Settings\User\Desktop\....

和在HTML文件中的此路径是

C:\Documents%20And%20Settings\User\Desktop\....

因此,一个文件未发现异常正在内部提出并停止进程,直到超时,并印不养它。

在Windows XP计算机上的进程在运行安装远程调试器后,我得到了第一次尝试的例外。

我不认为它正确的印为“吞噬”的例外,但是这是一个新的历史。

其他提示

你有没有确认,你可以用一个善意的邮件客户端发送相同的邮件,最好是简单的和便携式一个不集成到系统中的深处,像Mozilla Thunderbird或Opera的包括邮件客户端?有可能是一个反病毒/反垃圾邮件/ antiwhatever干扰系统存在 - 透明许多那些的截距传出25 / TCP和做的东西到数据

如果编码是不是这个原因,而是读超时,你可以使用ReadTimeOut属性增加它:

IdSMTP1.ReadTimeOut:= 20000;

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top