[PocketPC] send MMS using MAPI



This is for PocketPC. I posted on the pocketpc.developer newsgroup but no replies so I posted it here. :)

How do I send an MMS using CEMAPI? Currently I use several code snippets designed to send SMS and modify them to send MMS. I end up with the following code snippet which can placed the MMS into MMS Outbox folder and cause the phone to attempt to send the MMS, but a failure (error message: Unable to send MMS. Your message will remain in Outbox folder.) is reported just after the MMS data connection is established. The native composer can send and receive MMS successfully.

Code snippet:

// pointer to folder having PR_CE_IPM_DRAFTS_ENTRYID in message store with PR_DISPLAY_NAME = "MMS", e.g. drafts folder of MMS account
// This has been retrieved (code not shown)
IMAPIFolder* pfldrDrafts = NULL;

//pointer to message being created
LPMESSAGE pmsg;

//create the message to be sent
hr = pfldrDrafts->CreateMessage(NULL, 0, &pmsg);

//add recipients
SPropValue propRecipient[3]; ZeroMemory(&propRecipient, sizeof(propRecipient)); propRecipient[0].ulPropTag = PR_RECIPIENT_TYPE; propRecipient[0].Value.l = MAPI_TO; propRecipient[1].ulPropTag = PR_ADDRTYPE; propRecipient[1].Value.lpszW = L"MMS"; //originally this is L"SMS", I changed to MMS to point to MMS account
propRecipient[2].ulPropTag = PR_EMAIL_ADDRESS; propRecipient[2].Value.lpszW = L"111111"; //recipient phone number
ADRLIST adrlist; adrlist.cEntries = 1; adrlist.aEntries[0].cValues = 3; adrlist.aEntries[0].rgPropVals = (LPSPropValue)(&propRecipient); hr = pmsg->ModifyRecipients(MODRECIP_ADD, &adrlist);

//change other properties
SPropValue props[4]; ZeroMemory(&props, sizeof(props));

//PR_SUBJECT points to MMS contents. For simplicity, the MMS body and attachments

(pictures, audio has not yet been set)
props[0].ulPropTag = PR_SUBJECT; props[0].Value.lpszW = L"Hello World"; //message subject

//mark message as being sent out
props[1].ulPropTag = PR_MSG_STATUS;
props[1].Value.ul = MSGSTATUS_RECTYPE_SMS; //is it OK to use this flag (designed

for SMS)? or is there a similiar flag for MMS?
props[2].ulPropTag = PR_MESSAGE_FLAGS; props[2].Value.ul = MSGFLAG_FROMME | MSGFLAG_UNSENT;

//assign the property to the message
hr = pmsg->SetProps(sizeof(props) / sizeof(props[0]), (LPSPropValue)&props, NULL);

//send the message
hr = pmsg->SubmitMessage(0);

The above code can send SMS successfully just by modifying pfldrDrafts to point to SMS messag store and change propRecipient[1].Value.lpszW as commented.

Any ideas what I am missing out on? Thanks in advance. :)

Posted by JetBrains Omea Reader 1098.1


.



Relevant Pages

  • sending MMS using CEMAPI
    ... Currently I use several code snippets designed to send SMS and modify them to send MMS. ... I end up with the following code snippet which can placed the MMS into MMS Outbox folder and cause the phone to attempt to send the MMS, but a failure (error message: ...
    (microsoft.public.pocketpc.developer)
  • Re: Paul Thurrott - "You need an iPhone"
    ... This great new iPhone still does not do MMS. ... email can't substitute MMS since it's through the internet ... impletement a cellular-driven solution right now as they did SMS? ...
    (comp.sys.mac.advocacy)
  • Re: Orientation for SMS on PC
    ... > I had the impression that MMS was simply a structure over the core SMS ... > messaging transfer which split and re-merged larger media oriented ...
    (microsoft.public.win32.programmer.tapi)
  • Re: 3G iPhone for Europe in May 2008 apparently...
    ... for using SMS over email - I want to send a message that's going to be ... I still don't see how emailing a phone when you already know its phone ... phone to ring - what's different about wanting a picture to appear on ... I'll admit that I don't see much utility in MMS - I've had MMS-capable ...
    (uk.comp.sys.mac)
  • Re: Mobile in the States
    ... I think a tmobile USA prepaid sim is her best option. ... 25 cents per SMS and MMS respectively to any where in the world. ... it's free to receive both (Unlike over there, free incoming SMS and MMS ...
    (uk.telecom.mobile)