D
Dominik
Hi,
I am trying to notify the user about events of my application by placing an
item in his outlook inbox. Currently, I create a MailItem and save it (see
below). This brings two problems:
1. The sender field cannot be set. (It's always empty)
2. The e-mail is flagged as unsent message and thus the user can edit and
send it.
Is there a direct way to create pseudo-E-Mails in the Inbox or a solution to
the problems above? I cannot send a real e-mail, as notifcations have to be
instantaneous.
Thanks a lot.
Dominik
Code: (It's C++, but the object model is the same. So answers in any
language are fine!)
MAPIFolderPtr pInbox;
_ItemsPtr pInboxItems;
_MailItemPtr pNewMail;
pInbox = pMAPI->GetDefaultFolder(olFolderInbox);
pInboxItems = pInbox->Items;
pNewMail = pInboxItems->Add();
pNewMail->Subject = "New Mail Subject";
pNewMail->Body = "New mail body\n";
pNewMail->PutTo("(e-mail address removed)");
pNewMail->Save(); // saves to Drafts
pNewMail->Move(pInbox);
I am trying to notify the user about events of my application by placing an
item in his outlook inbox. Currently, I create a MailItem and save it (see
below). This brings two problems:
1. The sender field cannot be set. (It's always empty)
2. The e-mail is flagged as unsent message and thus the user can edit and
send it.
Is there a direct way to create pseudo-E-Mails in the Inbox or a solution to
the problems above? I cannot send a real e-mail, as notifcations have to be
instantaneous.
Thanks a lot.
Dominik
Code: (It's C++, but the object model is the same. So answers in any
language are fine!)
MAPIFolderPtr pInbox;
_ItemsPtr pInboxItems;
_MailItemPtr pNewMail;
pInbox = pMAPI->GetDefaultFolder(olFolderInbox);
pInboxItems = pInbox->Items;
pNewMail = pInboxItems->Add();
pNewMail->Subject = "New Mail Subject";
pNewMail->Body = "New mail body\n";
pNewMail->PutTo("(e-mail address removed)");
pNewMail->Save(); // saves to Drafts
pNewMail->Move(pInbox);