Create SMS draft by MAPI

Create SMS draft by MAPI

Post by WS5DLiBXd » Tue, 28 Nov 2006 12:07:02

Dear all,

I use MAPI to create SMS and send it.

I didn't set the CC. or BCC. recipients,
but as the SMS sent fail (eg. invalid phone number), it will left in
draft folder with both CC. BCC. recipient ???

I tried to use "ModifyRecipients()" and "MODRECIP_REMOVE" to remove
the unnecessary recipient, but the argument seems not support in PocketPC.

Any suggestion is appreciated.


Create SMS draft by MAPI

Post by Peter Foot » Tue, 28 Nov 2006 23:03:33

CEMAPI only supports MODRECIP_ADD. Therefore you'll need to read the current
recipients and then add the required ones to the message which will
overwrite the old collection.


Peter Foot
Device Application Development MVP |


Create SMS draft by MAPI

Post by WS5DLiBXd » Wed, 29 Nov 2006 17:43:01

thanks for reply , But i am not very sure of the description.
Do you mean after creating the SMS, I should call pMessage->GetProps() to
get recipients first,
and then use pMessage->ModifyRecipients (MODRECIP_ADD, &adrlist) to add my
own recipient????


Create SMS draft by MAPI

Post by WS5DLiBXd » Sat, 02 Dec 2006 12:19:00

Dear Peter,

Maybe I description was confusing.
I could Set/Get recipients in SMS and even modify them.

But I can't remove the unnecessary "CC" and "BCC" column that "should
NOT" exist in a SMS message. These two columns is alaways default created as
I generate a new SMS.

Is it the problem of my property setting???
My property setting is as below:

propRecipient[0].ulPropTag = PR_RECIPIENT_TYPE;
propRecipient[0].Value.l = MAPI_TO;
propRecipient[1].ulPropTag = PR_ADDRTYPE;
propRecipient[1].Value.lpszW = _T("SMS");
propRecipient[2].ulPropTag = PR_EMAIL_ADDRESS;
propRecipient[2].Value.lpszW = (LPWSTR)pcszTo;

props[0].ulPropTag = PR_SUBJECT;
props[0].Value.lpszW = (LPWSTR)pcszSubject;
props[1].ulPropTag = PR_MSG_STATUS;
props[1].Value.ul = MSGSTATUS_RECTYPE_SMS;
props[2].ulPropTag = PR_MESSAGE_FLAGS;
Best regards,