Re: Pocket PC 2003 MAPI Attachments

From: Chris Anderson (pssupport_at_NOSPAM.ecspl.com.au)
Date: 04/01/04


Date: Fri, 2 Apr 2004 09:45:56 +1000

Thanks to the help I've received from David Bergeron and Wayne Robshaw, I've
managed to resolve this issue. It seems to be a bug introduced into the
Pocket PC 2003 version of MAPI. So others who have the same problem can
find a solution, I've included the workaround here. The stream for the body
of the message is not being autosized properly, and needs to be sized to the
size of the body plus a little bit extra before streaming the text into it,
as demonstrated here:

ULARGE_INTEGER uiSize;

uiSize.QuadPart = ((MessageBody.GetLength()) * 2) + 1000;
pStream->SetSize(uiSize);

Then you can stream the text into the message body using the write command.
This problem only occurs under 2003, but the above fix works OK for both
2002 and 2003.

My thanks go to David who had discovered the workaround, and the additional
help provided by Wayne.

Chris Anderson

"David Bergeron" <daveberg@Adelphia.net> wrote in message
news:eeLjunxFEHA.2560@TK2MSFTNGP12.phx.gbl...
> Are you using the VOMAPI classes?
>
> "Chris Anderson" <pssupport@NOSPAM.ecspl.com.au> wrote in message
> news:e37Ho1rFEHA.692@TK2MSFTNGP09.phx.gbl...
> > Hi all
> >
> > I'm having a problem sending attachments to emails using MAPI under the
> > Pocket PC 2003 environment. My code worked fine under Pocket PC 2002,
but
> > in 2003 attachments don't end up being sent properly. After I send a
> > message and go to the Outbox of the Pocket PC Inbox, I can see and open
> the
> > attachment without any problems. However, when it's synchronised with
the
> > POP3 server, the attachment doesn't appear to the recipient, but instead
a
> > string such as the following:
> >
> > _000_0009_01C41353.658A6B00--
> >
> > is appended to the body text of the message.
> >
> > However, if I open the message in the Pocket PC Inbox before it is
> > synchronised with the server and press Send, the attachment will be sent
> to
> > the recipient correctly the next time I synchronise with the POP3
server.
> > So obviously I am attaching the file correctly, I must be just missing
> some
> > new flag or property that is required. At the bottom of this post I
have
> > attached the source of the messages once they have reached the recipient
> (if
> > that will help anyone), of one that had the attachment sent successfully
> > (sent from the Pocket PC Inbox), and one that didn't (sent from my
> program).
> > Please note that I have removed the headers.
> >
> > I've tried comparing the following properties of the message and its
> > attachment without pressing Send from the Pocket PC Inbox, and with it
> > pressed, and they match exactly:
> >
> > PR_HASATTACH
> > PR_MESSAGE_FLAGS
> >
> > PR_ATTACH_SIZE
> > PR_ATTACH_METHOD
> > PR_MSG_STATUS
> >
> > So there must be some other property that I'm not aware of that I now
have
> > to set?
> >
> > There seems to be no documentation at all on the Internet that can help
me
> > with this problem. I was hoping someone could help me with this,
because
> I
> > have spent the last couple of days on this problem and got absolutely
> > nowhere. Has anyone been able to send attachments successfully in
Pocket
> PC
> > 2003? Does anybody know what might have changed from 2002? Does anyone
> > have any suggestions? Any help will be very much appreciated.
> >
> > Regards
> >
> > Chris Anderson
> >
> >
>
> --------------------------------------------------------------------------
> --
> > ---
> > MSG SOURCE WHERE ATTACHMENT NOT SENT PROPERLY:
> >
> > <HEADER REMOVED>
> > Subject: From Program
> > Date: Fri, 26 Mar 2004 16:57:17 -0800
> > MIME-Version: 1.0
> > Content-Type: multipart/mixed;
> > boundary="----=_NextPart_000_0009_01C41353.658A6B00"
> > X-MimeOLE: Produced By Microsoft MimeOLE V5.00.1432.1
> >
> > This is a multi-part message in MIME format.
> >
> > ------=_NextPart_000_0009_01C41353.658A6B00
> > Content-Type: text/plain;
> > charset="iso-8859-1"
> > Content-Transfer-Encoding: 7bit
> >
>
> --------------------------------------------------------------------------
> --
> > ---
> > MSG SOURCE WHERE ATTACHMENT NOT SENT PROPERLY:
> >
> > <HEADER REMOVED>
> > Subject: From Inbox
> > Date: Fri, 26 Mar 2004 16:57:15 -0800
> > MIME-Version: 1.0
> > Content-Type: multipart/mixed;
> > boundary="----=_NextPart_000_0006_01C41353.64593E00"
> > X-MimeOLE: Produced By Microsoft MimeOLE V5.00.1432.1
> >
> > This is a multi-part message in MIME format.
> >
> > ------=_NextPart_000_0006_01C41353.64593E00
> > Content-Type: text/plain;
> > charset="iso-8859-1"
> > Content-Transfer-Encoding: base64
> >
> > ------=_NextPart_000_0006_01C41353.64593E00
> > Content-Type: text/plain;
> > name="TextDoc.txt"
> > Content-Transfer-Encoding: 7bit
> > Content-Disposition: attachment;
> > filename="TextDoc.txt"
> >
> > ------=_NextPart_000_0006_01C41353.64593E00--
> >
> >
>
>



Relevant Pages

  • Need help in syncronizing PPC 2002 with MS Outlook 2003
    ... Toshiba e-740 with Pocket ... >deletes messages from PPC's inbox during syncronization ... Exchange on your PC to the ActiveSync folder in Inbox on ... * Messages in the Outbox folder on your PPC are ...
    (microsoft.public.pocketpc.activesync)
  • Wheres my INBOX ? Its gone away
    ... I could make a long list of peculiarities with my Toshiba e335 Pocket PC ... as to why my INBOX seems to have disappeared. ... clicking on ACTIVESYNC to select another folder from the pull down menu I ... Also have OfficeScan virus checker on the Pocket PC and it detects no ...
    (microsoft.public.pocketpc.activesync)
  • Re: Wheres my INBOX ? Its gone away
    ... >I could make a long list of peculiarities with my Toshiba e335 Pocket PC ... > as to why my INBOX seems to have disappeared. ... > I have soft reset, hard reset, restored, re-synced, rebooted the PC, ... Also have OfficeScan virus checker on the Pocket PC and it detects no ...
    (microsoft.public.pocketpc.activesync)
  • Re: eMail Accounts - ActiveSync and POP3
    ... - one mailbox for ActiveSync (if you enable the "Inbox" sync in ActiveSync, ... - one mailbox for each POP3 account you configure on the Pocket PC ...
    (microsoft.public.pocketpc.activesync)