如何使用SharpDecodeOptions作为参数编写SharpMessage构造函数 [英] How to write SharpMessage constructor with SharpDecodeOptions as an argument
问题描述
彼得,你好,
创建Pop3MialClient时,我有几个问题想问您.我有一个Windows服务,我们在这里处理来自不同供应商的电子邮件.除来自Linux(Red Hat)系统的电子邮件外,该服务运行正常.我检查了一下,在Anmar支持团队的帮助下,我发现我们需要将SharpDecodeOptions.UuDecode标志添加到
适当的SharpMessage构造函数,因为电子邮件包含uuencoded附件.
以下是我现在用于GetRawEmail()的代码,根据支持团队的需要,我们在创建实例时需要标记构造函数.
Hi Peter,
I have few questions for you , while creating the Pop3MialClient. I have one windows service where we process emails from different vendors. The service is working fine except the emails from Linux (Red Hat) system. I checked and with help of Anmar support team I found we need to add the SharpDecodeOptions.UuDecode flag to the
appropriate SharpMessage constructor as the email contains the uuencoded attachments.
The below is the code which I use now for GetRawEmail (), As per the support team we need to flag the constructor while we create the instance.
public bool GetRawEmail(int MessageNo, out string EmailText) {
//send ''RETR int'' command to server
if (!SendRetrCommand(MessageNo)) {
EmailText = null;
return false;
}
//get the lines
string response;
int LineCounter = 0;
//empty StringBuilder
if (RawEmailSB==null) {
RawEmailSB = new StringBuilder(100000);
} else {
RawEmailSB.Length = 0;
}
isTraceRawEmail = true;
while (readMultiLine(out response)) {
LineCounter += 1;
}
EmailText = RawEmailSB.ToString();
m_spop3Message = new SharpMessage(EmailText);
mailattachments = new SharpAttachment[m_spop3Message.Attachments.Count];
m_spop3Message.Attachments.CopyTo(mailattachments, 0);
TraceFrom("email with {0} lines, {1} chars received", LineCounter.ToString(), EmailText.Length);
return true;
}
请帮助我如何为SharpMessage构造函数设置标志???:confused:以便我能够阅读uuencoded附件以及常规电子邮件.
在此先感谢,
Aurosish.
Please help me how do I set the flag for the SharpMessage constructor ???:confused: so that I can able to read the uuencoded attachment along with the regular emails.
Thanks in Advance,
Aurosish.
推荐答案
转到网站 SharpMimeTools [ ^ ]并查看SharpMessage类能够找到此 [
Go to the web site for the SharpMimeTools[^] and look at the SharpMessage class you should be able to find this[^] which shows what you are after.
这篇关于如何使用SharpDecodeOptions作为参数编写SharpMessage构造函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!