Saturday, February 23, 2008

MAPI and SMS delivery reports?

Well,Have you ever wanted to Send SMS using MAPI?

Well it is not that hard,you simple call IMessage->SubmitMessage(0);

But what about delivery reports?

Just set these two properties using IMessage->SetProps to true!

PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED
PR_PROOF_OF_DELIVERY_REQUESTED

Here is code snippet ::

props[0].ulPropTag = PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED;
props[0].Value.b = TRUE;

props[1].ulPropTag = PR_PROOF_OF_DELIVERY_REQUESTED;
props[1].Value.b = TRUE;

hr = spMessage->SetProps(2, (LPSPropValue)&props, NULL);