【发布时间】:2017-01-16 23:27:18
【问题描述】:
我一直在使用 Delphi 7 的演示来玩弄 Indy 9 中的 SMTP 客户端和服务器组件。一切正常。但是,当我 telnet 进入服务器时,演示只显示电子邮件主题和邮件正文,From: 和 To: 字段没有显示。
下面的代码显示AMsg缺少相关数据。
procedure TForm1.IdSMTPServer1ReceiveMessageParsed(ASender: TIdCommand;
var AMsg: TIdMessage; RCPT: TIdEMailAddressList;
var CustomError: String);
begin
// This is the main event if you have opted to have the idSMTPServer to do your parsing for you.
// The AMessage contains the completed TIdMessage.
// NOTE: Dont forget to add IdMessage to your USES clause!
ToLabel.Caption := AMsg.Recipients.EMailAddresses;
FromLabel.Caption := AMsg.From.Text;
SubjectLabel.Caption := AMsg.Subject;
Memo1.Lines := AMsg.Body;
// Implement your file system here :)
end;
任何人都可以提出一个理由吗? 首先,感谢雷米的回复。 其次,我似乎还不能在这里发布图片,但这里是服务器远程登录会话图片的链接https://postimg.org/image/f0n9j0kcx/。 telnet 会话显示服务器响应。 也感谢您提醒我有关 Wireshark 以及使用 TIdLog 组件的建议。
【问题讨论】:
-
欢迎来到 StackOverflow。请显示您通过 Telnet 发送的实际命令,您可能遗漏了什么。
-
如何发布我的 Telnet 会话的图像?它是在评论中出现,还是我点击“回答您的问题”?
-
最好从终端窗口复制/粘贴实际命令,而不是发布图像。但无论哪种方式,请edit your question 包含新信息,不要在答案或评论中发布。
标签: delphi delphi-7 indy indy-9