diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-1DCB0B64-0B70-4F34-81A7-E00A996AD626.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-1DCB0B64-0B70-4F34-81A7-E00A996AD626.dita Tue Mar 30 11:56:28 2010 +0100 @@ -0,0 +1,73 @@ + + + + + +Listing, +Accessing and Launching MailboxesThis section describes how to list, access and launch mailboxes +using Email Client APIs. +

Email Client +provides MEmailMailbox::GetMailboxesL() method to list +all the mailboxes. MEmailMailbox::ShowInboxL() method is +used to launch a specific mailbox in the email application.

+ +Create an instance +of MEmailClientApi class. +

EmailInterfaceFactory* factory = CEmailInterfaceFactory::NewL(); +CleanupStack::PushL( factory ); +MEmailClientApi* mailClient = static_cast<MEmailClientApi*>(factory->InterfaceL( KEmailClientApiInterface ) );

+
+Get the mailboxes +using MEmailMailbox::GetMailboxesL(RMailboxPtrArray& aMailboxes). +

RMailboxPtrArray mailboxes; +CCleanupResetAndRelease<MEmailMailbox>::PushL( mailboxes ); +mailClient->GetMailboxesL( mailboxes ); +

+
+Launch the inbox +using MEmailMailbox::ShowInboxL(). +

mailbox->ShowInboxL();

To access a mailbox +using its address, use MEmailMailbox::MailboxL( const TPtrC& +aAddress) method.

+
+
+

The following code snippet shows an example of how to list the +mailboxes.

TInt CEmailClientApiTester::GetMailboxListL( CItemParser& /*aItem*/ ) + { + TInt ret(KErrNone); + + CEmailInterfaceFactory* factory = CEmailInterfaceFactory::NewL(); + CleanupStack::PushL( factory ); + MEmailClientApi* mailClient = static_cast<MEmailClientApi*>(factory->InterfaceL( KEmailClientApiInterface ) ); + if ( mailClient ) + { + CleanupReleasePushL( *mailClient ); + RMailboxPtrArray mailboxes; + mailClient->GetMailboxesL( mailboxes );// Get the mailboxes + for ( TInt i = 0; i < mailboxes.Count(); i++ ) + { + MEmailMailbox* mailbox = mailboxes[i]; + iLog->Log( _L( "%S id=%d" ), &mailbox->MailboxName(), mailbox->MailboxId().iId ); + mailbox->Release(); //Release the memory + } + mailboxes.Close(); + CleanupStack::PopAndDestroy();// mailClient + } + CleanupStack::PopAndDestroy(factory); + return ret; + } +

+
+Email Client +API Overview +Creating, +Replying and Forwarding Email Messages +Searching +Email Messages +
\ No newline at end of file