Sending E-mail
This code sample is named SendMail. It demonstrates how to programmatically send e-mail messages using the Messaging APIs (MAPI). The application sends an e-mail message, per account, to a list of recipients. It stores one message per each account on the mobile device (POP3, ActiveSync, etc), in the account's Outbox.
FreeProws function
IMAPIFolder::CreateMessage function
IMAPIProp::GetProps function
IMAPISession::GetMsgStoresTable function
IMAPISession::OpenMsgStore function
IMAPITable::QueryRows function
IMessage::SubmitMessage function
IMsgStore::OpenEntry function
MAPIFreeBuffer function
MAPILogonEx function
SRowSet function
-
Logs onto the message store.
-
Gets the message store's table.
-
For each local account:
-
Opens the current store entry.
-
Gets the Drafts folder (necessary for outgoing mail).
-
Creates a new message in this folder.
-
Sets relevant message properties (Recipients, Subject, Body, etc).
-
Creates a file attachment.
-
Sends the message.
-
Cleans up.
-
Opens the current store entry.
-
Navigate to the solution file (*.sln), and double-click it. By default, the solution files are copied to the following folders:
C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\Common\CPP\Win32\SendMail
Microsoft Visual Studio launches and loads the solution.
-
Build the solution (Ctrl+Shift+B).
-
Deploy the solution (F5).
-
After running the application, check your Outbox or Sent Items folder. Depending on your network or partnership access, you will see your message(s).