.NET Components for Mobility

why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

Last post 12-26-2007 3:48 AM by PeterFoot. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 12-18-2007 10:12 PM

    why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    Hi,everybody! I try get  EmailMessage.Subject and EmailMessage.BodyText by these codes, I can get correct EmailMessage.Subject,but get the blank EmailMessage.BodeText.Why?And how can I add new  EmailAccount?(Visual Studio 2005,WM6)

    InTheHand .WindowsMobile.PocketOutlook.OutlookSession os=new         InTheHand.WindowsMobile.PocketOutlook.OutlookSession();
    InTheHand.WindowsMobile.PocketOutlook.EmailMessageFolder ef = os.EmailAccounts["name"].Inbox;
    string subject = ef[0].Subject;
    string bodytext = ef[0].BodyText;

    Regards

    Filed under:
  • 12-19-2007 3:14 AM In reply to

    Re: why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    Which version of the library are you using? Please give the full build version of the dll. Email accounts can be added using the WindowsMobile.Configuration namespace using the EMAIL2 provider:-

    http://msdn2.microsoft.com/en-us/library/aa455896.aspx

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 12-21-2007 11:15 PM In reply to

    Re: why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    Thanks for your help,Peter.The vision of dll is V2.0.60220.1. I add Email accounts as the example,but always get error #2147500037.And the code is like this:

    XmlDocument xdoc = new XmlDocument();
    XmlDocument _xdoc = new XmlDocument();
    xdoc.Load(olive.olivepath + "\\OliveEmailAccount.xml");
    _xdoc = Microsoft.WindowsMobile.Configuration.ConfigurationManager.TestConfiguration(xdoc, true);
    _xdoc.Save(olive.olivepath + "\\1_xdoc.xml");

    OliveEmailAccout.xml:

    <?xml version="1.0" encoding="utf-8" ?>
     <net-provisioningdoc>
       <characteristic type="EMAIL2">
        <characteristic type="{GUID}">
          <parm name="SERVICENAME" value="live.cn" />
          <parm name="SERVICETYPE" value="POP3" />
          <parm name="INSERVER" value="pop3.live.cn" />
          <parm name="OUTSERVER" value="stmp.live.cn" />
          <parm name="AUTHREQUIRED" value="1" />
           <characteristic type="TAGPROPS">
            <parm name="8128000B" value="1" />
            <parm name="812C000B" value="1" />
          </characteristic>
          <parm name="AUTHNAME" value="aimar1900@live.cn" />
          <parm name="AUTHSECRET" value="19001984" />
          <parm name="REPLYADDR" value="aimar1900@live.cn" />
        </characteristic>
      </characteristic>
    </net-provisioningdoc>

     

  • 12-22-2007 8:09 AM In reply to

    Re: why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    Firstly the outer xml element should be wap-provisioningdoc not net-provisioningdoc. Secondly did you replace {guid} with your own unique guid (use the GuidGen tool to create your own).

     Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 12-22-2007 11:40 AM In reply to

    Re: why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    Thak you,Peter.I have found what's wrong in my code:Smile

  • 12-23-2007 4:02 AM In reply to

    Re: why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    HI,Peter!Now I can add new Email Account with your help,but when I try to delete Email Account by this code,cann't delete Email Account successfully.

     XmlDocument xdoc = new XmlDocument();
                xdoc.LoadXml(
                    "<wap-provisioningdoc>" +
                        "<Delete>" +
                         "<CmdID>100</CmdID>" +
                             "<Item>" +
                                "<Target>" +
                                    "<LocURI>./Vendor/MSFT/EMAIL2/{" + MyEmailGUID + "}</LocURI>" +
                                 "</Target>" +
                            "</Item>" +
                        "</Delete>" +
                   " </wap-provisioningdoc>");
                XmlDocument _xdoc = Microsoft.WindowsMobile.Configuration.ConfigurationManager.ProcessConfiguration(xdoc,true);
    _xdoc.Save(olive.olivepath + "\\Delete.xml");

  • 12-25-2007 8:29 AM In reply to

    Re: why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    Thank you,Peter!Now I can delete Email Account successfully,but I still don't know how to get EmailMeaasge's BodyText.

  • 12-26-2007 3:48 AM In reply to

    Re: why I cann't get EmailMessage.BodyText?And how can I add a new EmailAccount?

    There were some issues with the initial 2.0 release when retreiving the body text, depending on the encoding of the message and the type of email account. You can upgrade to 2.1 to resolve this. If you send me an email or private message with your Handango order reference and your forum username I'll set you up with access to the 2.1 update.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
Page 1 of 1 (8 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.