Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 11:38, 24 August 2007.

TSS000455 - Creating e-mail accounts in code

From Forum Nokia Wiki


Subject:

Creating e-mail accounts in code TSS000455

 

Platform(s): Device(s), SW version(s):
S60 3rd Edition  

Category:

Symbian C++

Subcategory:

-

Description:

Symbian OS v9.1 offers a new API for easy e-mail (POP3, IMAP4) account creation. The CEmailAccounts API creates an account for incoming messages as well as for outgoing messages (SMTP) and assigns these two together to form a working account pair.
Here is a simple example on how to use this API:
#include <cemailaccounts.h>
TMsvId pop3Id;
TMsvId smtpId;
iPop3Mtm = static_cast<CPop3ClientMtm*>(iReg->NewMtmL(KUidMsgTypePOP3));
iSmtpMtm = static_cast<CSmtpClientMtm*>(iReg->NewMtmL(KUidMsgTypeSMTP));
CEmailAccounts* accounts = CEmailAccounts::NewLC();
//
// Create CImPop3Settings and CImSmtpSettings objects and insert your account settings.
// This step is omitted here for brevity.
//
//
// You also need to define a CImIAPPreferences object for the IAP to use with this account.
// This example does not show how to fill in the IAP UID into apUid. One possibility is to read this value from the
// CommsDB IAP table by a bearer.
//
TUint32 apUid;
// Create a new IAPChoice for the IAPPreferences object
TImIAPChoice apChoice;
apChoice.iIAP = apUid;  //store IAP id
apChoice.iDialogPref = ECommDbDialogPrefPrompt; //prompt dialog
//CImIAPPreferences*
apPrefs = CImIAPPreferences::NewLC();
apPrefs->AddIAPL(apChoice);
// Now create actual services
//
TPopAccount popAcc;
popAcc = accounts->CreatePopAccountL(_L("POP3 acco"), *iPOP3Settings, *apPrefs, EFalse);
TSmtpAccount smtpAcc;
smtpAcc = accounts->CreateSmtpAccountL(popAcc, *iSmtpSettings, *apPrefs, EFalse);
pop3Id = popAcc.iPopService;
smtpId = smtpAcc.iSmtpService;
//
// Finally, this line sets the new SMTP service as the default sending service.
//
accounts->SetDefaultSmtpAccountL(smtpAcc);

Creation date:

October 19, 2006

Last modified:

-
Related Discussions
Thread Thread Starter Forum Replies Last Post
Automatically connect DUN with 6310 hero_nr_1 Bluetooth Technology 4 2002-06-04 12:49
Nokia POP3 Mail Client Emulator onemail General Symbian C++ 0 2003-09-22 11:51
POP3 Mail wraper General Messaging 0 2002-09-18 16:15
how to convert TBuf into CRichText? symbee General Symbian C++ 22 2006-08-07 09:55
ADD-IN for mail client hassan21006 General Symbian C++ 4 2007-04-20 15:21
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZemailQ
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX