Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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;
    }



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.
Posted

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900