If anyone could please help with a solid example, here is an attempt I started to try to call a function called "NEW_OUTGOING" when ever a new sms message is being sent, hopefully somebody can show me what's wrong with it? Or if not will this, then any cemail event triggering examples. I know how to cycle through and look up any sms. email, etc but cant figure out how to properly call the handlers.
// *********** CHECK FOR NEW OUTGOING MAIL **************************** //
MAPI map = new MAPI();
//create notification for new outgoing mail
cemapi.NEWMAIL_NOTIFICATION notify=new cemapi.NEWMAIL_NOTIFICATION(null,null,EMessageFlags.MSGFLAG_SUBMIT);
//get all stores
IMAPIMsgStore[] stores= map.MessageStores;
//cycle through all until sms store is found
foreach (IMAPIMsgStore store in stores)
{
if (store.DisplayName == "SMS")
{
//open the outbox of sms
IMAPIFolder ifold = store.OutboxFolder.OpenFolder();
//set notify to monitor SMS outbox for new messages
notify = new cemapi.NEWMAIL_NOTIFICATION(ifold.EntryID, store.EntryID, EMessageFlags.MSGFLAG_UNSENT);
}
}
//completely lost, trying to create handler to launch NEW_OUTGOING function when new SMS messages are sent
cemapi.AdviseNewMailHandler mail = new cemapi.AdviseNewMailHandler(NEW_OUTGOING);
mail += new cemapi.AdviseNewMailHandler(NEW_OUTGOING);
mail.Invoke(EEventMask.fnevObjectMoved, notify);
// *********** CHECK FOR NEW OUTGOING MAIL **************************** //
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If anyone could please help with a solid example, here is an attempt I started to try to call a function called "NEW_OUTGOING" when ever a new sms message is being sent, hopefully somebody can show me what's wrong with it? Or if not will this, then any cemail event triggering examples. I know how to cycle through and look up any sms. email, etc but cant figure out how to properly call the handlers.
// *********** CHECK FOR NEW OUTGOING MAIL **************************** //
MAPI map = new MAPI();
//create notification for new outgoing mail
cemapi.NEWMAIL_NOTIFICATION notify=new cemapi.NEWMAIL_NOTIFICATION(null,null,EMessageFlags.MSGFLAG_SUBMIT);
//get all stores
IMAPIMsgStore[] stores= map.MessageStores;
//cycle through all until sms store is found
foreach (IMAPIMsgStore store in stores)
{
if (store.DisplayName == "SMS")
{
//open the outbox of sms
IMAPIFolder ifold = store.OutboxFolder.OpenFolder();
//set notify to monitor SMS outbox for new messages
notify = new cemapi.NEWMAIL_NOTIFICATION(ifold.EntryID, store.EntryID, EMessageFlags.MSGFLAG_UNSENT);
}
}
//completely lost, trying to create handler to launch NEW_OUTGOING function when new SMS messages are sent
cemapi.AdviseNewMailHandler mail = new cemapi.AdviseNewMailHandler(NEW_OUTGOING);
mail += new cemapi.AdviseNewMailHandler(NEW_OUTGOING);
mail.Invoke(EEventMask.fnevObjectMoved, notify);
// *********** CHECK FOR NEW OUTGOING MAIL **************************** //
hello
did you find solution to your problem , can you please share it here i also looking for it
Thanks