Joshi.Utils.Imap.Imap.FetchPartBody C# (CSharp) Method

FetchPartBody() public method

Fetch the body for specified part
public FetchPartBody ( string sMessageUID, string sMessagePart, string &sData ) : void
sMessageUID string Message uid
sMessagePart string Message part
sData string
return void
        public void FetchPartBody(string sMessageUID,
            string sMessagePart,
            ref string sData)
        {
            if (!m_bIsLoggedIn)
            {
                try
                {
                    Restore(true);
                }
                catch (ImapException e)
                {
                    if (e.Type != ImapException.ImapErrorEnum.IMAP_ERR_INSUFFICIENT_DATA)
                        throw e;

                    throw new ImapException(ImapException.ImapErrorEnum.IMAP_ERR_NOTCONNECTED);
                }
            }
            if (!m_bIsFolderSelected && !m_bIsFolderExamined)
            {
                throw new ImapException(ImapException.ImapErrorEnum.IMAP_ERR_NOTSELECTED);
            }
            if (sMessageUID.Length == 0)
                throw new ImapException(ImapException.ImapErrorEnum.IMAP_ERR_INVALIDPARAM);
            string sPart = sMessagePart;
            if (sPart.Length == 0 )
                sPart = IMAP_MSG_DEFAULT_PART;
            try
            {

                GetBody(sMessageUID,sPart, ref sData);

            }
            catch (ImapException e)
            {
                throw e;
            }
        }