.NET Components for Mobility

Add a full message in pocket outlook inbox

Last post 11-10-2008 9:16 PM by Inophage. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-22-2008 5:04 AM

    Add a full message in pocket outlook inbox

    Hello,
    I want to develop an C# application.
    I have access to the web only on ports 80 and 8080 with my phone, so POP3 mail(port 110) doesn't work with pocket Outlook.
    That is why I want to develop an application that retrieves messages with a PHP script on a personnal website (port 80).
    With theses retrieved messages, I want them add to the pocket Outlook inbox.

    I can add new messages with some fields(from, subject and body) but some fields are read-only such as "to", "received" and "bodyRaw"
    Is there a way to set these read-only fields with InTheHand library ?
    If not, is there a way to set these fields with some personnal codes ?

    Inophage

    Sorry for my poor english.

  • 10-23-2008 4:30 AM In reply to

    Re: Add a full message in pocket outlook inbox

    The To property is a collection - so you don't replace it you Add() recipient items to it. If you want to manually set the received date use

    Properties[MessageProperty.MessageDeliveryTime]

    Remember to call Update() to save changes to the message store.

    Peter

  • 10-23-2008 6:26 PM In reply to

    Re: Add a full message in pocket outlook inbox

    Thank you, "MessageDeliveryTime" and "To" fields work fine now.


    I have two other questions.

    First question :
    I tried to add an attachment but I don't know what I forgot to make it work.

    I tried this code :
              AppSession = new OutlookSession();
              emailsAccounts = AppSession.EmailAccounts;
              emailsAccount = emailsAccounts[0];
              emails = emailsAccount.Inbox;
              myEmail = emails.AddNew();
              ...
              ...
              ...
              myEmail.Attachments.Add(new Attachment(@"\Temp\mail2.xml"));
              myEmail.Properties[MessageProperty.HasAttachments] = true; // Or 1 ?
              myEmail.Attachments.Add(new Attachment(@"\Temp\mail3.xml"));
              myEmail.Update();
              AppSession.Dispose();

    But I don't see my Attachments in the message.


    Second question :

    Is it possible to add a HTML message (Windows Mobile 6.1) ? ( How can I set the original message body ? I have to set the BodyRaw, the MimeText or another field ? )
    For this moment, I can only set the content of a message with the "BodyText" property.

     

    Inophage

  • 10-29-2008 2:56 PM In reply to

    Re: Add a full message in pocket outlook inbox

     Hi Peter,

    Do you think these fields can be set with inthehand or not ? [I talk about BodyRaw(or HTML body Message) and attachments]

    Thanks,

    Inophage

  • 10-29-2008 7:36 PM In reply to

    Re: Add a full message in pocket outlook inbox

    Attachments can be set but you must call the Update method to save them. You cannot set the BodyRaw property as this is written to a stream property and these are not currently supported by the Properties collection.

    Peter

  • 11-08-2008 8:12 AM In reply to

    Re: Add a full message in pocket outlook inbox

     I try again to add an attachment in an email message (Windows Mobile 6 Porfessionnal).

    I add a new message in drafts folder, add attachment with an existing file and update the message. But when I open the message, I see the Attachment field, but this field is empty. Do I forget something ?

              email = emails.AddNew();
              AttachmentCollection Atts = email.Attachments;   
              Attachment Att = new Attachment(@"\My documents\My Pictures\Flower.jpg");
              Atts.Add(Att);
              email.Update();

              //Atts = email.Attachments;
              //email.Properties[MessageProperty.HasAttachments]     return true
              // MessageBox.Show(Atts.Count.ToString());   return 1    

     When I create with outlook a message with an attachment, attachment.name return "Flower.jpg",  and when I create a message with ITH with an attachment, attachment.name return "\My documents\My Pictures\Flower.jpg", it's strange, isn't it ?

     Can you give us a working sample to add an attachment with an email message, please ?

    Best regards,

    Inophage

     

    Filed under: , ,
  • 11-10-2008 9:16 PM In reply to

    Re: Add a full message in pocket outlook inbox

     I found this sample in Microsoft site :

        Set objAttach = objAttachColl.Add ' add an attachment
    With objAttach
    .Type = CdoFileLink
    .Position = 0 ' place at beginning of message
    .Source = "\\server\bitmaps\honey.bmp" ' UNC name
    End With
    ' must update the message to save the new info
    objOneMsg.Update ' update the message
    MsgBox "Added an attachment of type CdoFileLink"
     
    But we can't define the type and the position of an attachment. 

     

Page 1 of 1 (7 items)
Copyright © 2001-2012 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting