当前位置: 首页>>代码示例>>C++>>正文


C++ CEmailAccounts::LoadSmtpSettingsL方法代码示例

本文整理汇总了C++中CEmailAccounts::LoadSmtpSettingsL方法的典型用法代码示例。如果您正苦于以下问题:C++ CEmailAccounts::LoadSmtpSettingsL方法的具体用法?C++ CEmailAccounts::LoadSmtpSettingsL怎么用?C++ CEmailAccounts::LoadSmtpSettingsL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CEmailAccounts的用法示例。


在下文中一共展示了CEmailAccounts::LoadSmtpSettingsL方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ResetSettingsL

LOCAL_C void ResetSettingsL(TBool aSecureSocket)
	{
	_LIT(KSmtpServer, "smtp.demon.co.uk");
	_LIT(KSmtpEmailAlias, "SMTP STARTTLS");
	_LIT(KSmtpEmailAddress, "<[email protected]>");

	// Overwrite the setings with test code one.  Don't want the default settings.
	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
	CleanupStack::PushL(settings);
	
	CEmailAccounts* accounts = CEmailAccounts::NewLC();
	
	TSmtpAccount smtpAccountId;
	accounts->GetSmtpAccountL(smtpService,smtpAccountId); 
	accounts->LoadSmtpSettingsL(smtpAccountId, *settings);

	settings->SetServerAddressL(KSmtpServer);
	settings->SetEmailAliasL(KSmtpEmailAlias);
	settings->SetEmailAddressL(KSmtpEmailAddress);
	settings->SetReplyToAddressL(KSmtpEmailAddress);
	settings->SetBodyEncoding(EMsgOutboxMIME);
	settings->SetReceiptAddressL(KSmtpEmailAddress);
	settings->SetSecureSockets(aSecureSocket);
	settings->SetPort(25);
	
	accounts->SaveSmtpSettingsL(smtpAccountId, *settings);

	CleanupStack::PopAndDestroy(2, settings); //settings, store/accounts
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:29,代码来源:T_SMTSSECURESOCKETS.cpp

示例2: LoadSettingsL

void CMtfTestActionGetPopAccountSettings::LoadSettingsL(CEmailAccounts& aAccounts, const TPopAccount& aAccount, CImPop3Settings& aPopSettings, CImIAPPreferences& aPopIapSettings, CImSmtpSettings& aSmtpSettings, CImIAPPreferences& aSmtpIapSettings)
	{
	aAccounts.LoadPopSettingsL(aAccount, aPopSettings);
	aAccounts.LoadPopIapSettingsL(aAccount, aPopIapSettings);
	TSmtpAccount smtpAccount;
	aAccounts.GetSmtpAccountL(aAccount.iSmtpService, smtpAccount);
	aAccounts.LoadSmtpSettingsL(smtpAccount, aSmtpSettings);
	aAccounts.LoadSmtpIapSettingsL(smtpAccount, aSmtpIapSettings);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:9,代码来源:CMtfTestActionGetPopAccountSettings.cpp

示例3: LoadAccountSettingsL

/**
LoadAccountSettingsL()
This function loads the IMAP and SMTP settings object from the IMAP account given

@param aEmailAccount
An object of type CEmailAccounts

@param aAccount
An object of type TPopAccount

@param aPopSettings
An object of type CImPop3Settings

@param aPopIapSettings
An object of type CImIAPPreferences

@param aSmtpSettings
An object of type CImSmtpSettings

@param aSmtpIapSettings
An object of type CImIAPPreferences

@return : void
*/	
void CT_MsgComparePopSettings::LoadAccountSettingsL(CEmailAccounts& aEmailAccount, const TPopAccount& aAccount, CImPop3Settings& aPopSettings, 
		CImIAPPreferences& aPopIapSettings,CImSmtpSettings& aSmtpSettings, CImIAPPreferences& aSmtpIapSettings)
	{
	aEmailAccount.LoadPopSettingsL(aAccount, aPopSettings);
	aEmailAccount.LoadPopIapSettingsL(aAccount, aPopIapSettings);
	
	TSmtpAccount smtpAccount;
	aEmailAccount.GetSmtpAccountL(aAccount.iSmtpService, smtpAccount);
	aEmailAccount.LoadSmtpSettingsL(smtpAccount, aSmtpSettings);
	aEmailAccount.LoadSmtpIapSettingsL(smtpAccount, aSmtpIapSettings);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:35,代码来源:T_ComparePopSettings.cpp

示例4: RestoreSettingsL

EXPORT_C void CSmtpClientMtm::RestoreSettingsL()
/** Loads into the object's cache the service settings from the Central Repository
for the current entry. */
	{
	__ASSERT_DEBUG(iMsvEntry->Entry().iType.iUid==KUidMsvServiceEntryValue, gPanic(ESmtcMTMNotAServiceEntry));

	CEmailAccounts* account = CEmailAccounts::NewLC();
  	TSmtpAccount id;
	account->GetSmtpAccountL(iMsvEntry->Entry().Id(), id);
	account->LoadSmtpSettingsL(id, *iImSmtpSettings);
	CleanupStack::PopAndDestroy(account);    
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:12,代码来源:SMTCMTM.CPP

示例5: CreateMessageL

EXPORT_C void CSmtpClientMtm::CreateMessageL(TMsvId aServiceId)
/** Creates a new message entry as a child of the current context.

@param aServiceId ID of the service to own the entry. */
	{
	// fix for DEF051564 - SMTP client MTM CreateMessageL not creating message in correct state
	TMsvEmailTypeList emailTypeList = KMsvEmailTypeListInvisibleMessage | KMsvEmailTypeListMessageInPreparation;

	CEmailAccounts* account = CEmailAccounts::NewLC();
	
	CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings;
	CleanupStack::PushL(smtpSettings);
  	TSmtpAccount id;
	account->GetSmtpAccountL(aServiceId, id);
	account->LoadSmtpSettingsL(id, *smtpSettings);
	
	switch (smtpSettings->BodyEncoding())
		{
		case EMsgOutboxMHTMLAsMIME:
		case EMsgOutboxMHTMLAlternativeAsMIME:
			emailTypeList |= KMsvEmailTypeListMHTMLMessage;
			break;
		case EMsgOutboxDefault:
		case EMsgOutboxNoAlgorithm:
		case EMsgOutboxMIME:
			break;
		}
	CleanupStack::PopAndDestroy(2, account); // smtpSettings, account
	
	// Now invoke the create new mail operation.
	// Note that it is wrapped up to make the asynchronous call synchronous.
	CMsvOperationActiveSchedulerWait* waiter=CMsvOperationActiveSchedulerWait::NewLC();
	CImEmailOperation* createNewMailOp = CImEmailOperation::CreateNewL(waiter->iStatus, iMsvEntry->Session(), iMsvEntry->Entry().Id(), aServiceId, KMsvMessagePartBody|KMsvMessagePartAttachments, emailTypeList, KUidMsgTypeSMTP);
	CleanupStack::PushL(createNewMailOp);
	waiter->Start();

	// The the entry is expected to be set to the new message.
	TMsvId temp;	
	TPckgC<TMsvId> paramPack(temp);
	const TDesC8& progBuf = createNewMailOp->ProgressL();	
	paramPack.Set(progBuf);
	TMsvId messageId = paramPack();
	iMsvEntry->SetEntryL(messageId);
	
	CMsvStore* store = iMsvEntry->ReadStoreL();
	CleanupStack::PushL(store);
	iHeader->RestoreL(*store);

	CleanupStack::PopAndDestroy(3, waiter); // waiter, createNewMailOp, store	
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:50,代码来源:SMTCMTM.CPP

示例6: SetAddVCardToEmailL

LOCAL_C void SetAddVCardToEmailL(TBool addVCard, TMsvId serviceId)
	{
	CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings;
	CleanupStack::PushL(smtpSettings);

	CEmailAccounts* accounts = CEmailAccounts::NewLC();
	TSmtpAccount smtpAccount;
	accounts->GetSmtpAccountL(serviceId, smtpAccount);
	accounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings);

	smtpSettings->SetAddVCardToEmail(addVCard);
	
	accounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings);

	CleanupStack::PopAndDestroy(2); // smtpSettings, accounts
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:16,代码来源:T_imcm02d2.cpp

示例7: SetSignatureToEmailL

LOCAL_C void SetSignatureToEmailL(TBool addSignature, TMsvId serviceId)
	{
	CImSmtpSettings* smtpSettings = new (ELeave) CImSmtpSettings;
	CleanupStack::PushL(smtpSettings);

	CEmailAccounts* accounts = CEmailAccounts::NewLC();
	TSmtpAccount smtpAccount;
	accounts->GetSmtpAccountL(serviceId, smtpAccount);
	accounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings);

	smtpSettings->SetAddSignatureToEmail(addSignature);
	
	accounts->SaveSmtpSettingsL(smtpAccount, *smtpSettings);

	CleanupStack::PopAndDestroy(2); // smtpSettings, accounts

	if (addSignature)
		testUtils->WriteComment(_L("\tAdd VCard"));
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:19,代码来源:T_imcm02d2.cpp

示例8: CreateNewSmtpSettingsL

LOCAL_C void CreateNewSmtpSettingsL()
	{
	testUtils->iMsvEntry->SetEntryL(smtpService);
	TMsvId serviceId = smtpService;
	//overwrite the settings with test code one.  Don't want the default settings.
	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
	CleanupStack::PushL(settings);
	CEmailAccounts* accounts = CEmailAccounts::NewLC();
	TSmtpAccount smtpAccountId;
	accounts->GetSmtpAccountL( serviceId, smtpAccountId);
	accounts->LoadSmtpSettingsL(smtpAccountId, *settings);
	TInt serverLength = testUtils->MachineName().Length();
	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
	CleanupStack::PushL(serverad);
	serverad->Des().Copy(testUtils->MachineName());
	serverad->Des().Append(KServer);	
    settings->SetServerAddressL(*serverad);
    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
   	CleanupStack::PushL(emailaddress);
   	emailaddress->Des().Copy(testUtils->MachineName());
   	emailaddress->Des().Append(KAt);
   	emailaddress->Des().Append(*serverad);
   	settings->SetEmailAddressL(*emailaddress);
	settings->SetReplyToAddressL(*emailaddress);
	settings->SetReceiptAddressL(*emailaddress);
	settings->SetEmailAliasL(_L("Test Account"));
	settings->SetBodyEncoding(EMsgOutboxMIME);
	settings->SetRequestReceipts(EFalse);
	settings->SetPort(25);
	TSmtpAccount smtpAccount;
 	accounts->GetSmtpAccountL(smtpService, smtpAccount);
	accounts->SaveSmtpSettingsL(smtpAccount, *settings);
	CleanupStack::PopAndDestroy(emailaddress);
	CleanupStack::PopAndDestroy(serverad);
	CleanupStack::PopAndDestroy(2,settings);
	testUtils->WriteComment(_L("Created New SmtpSettings  "));	
		
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:38,代码来源:T_INC083099_Enquire_Email_Structure.cpp

示例9: AddRecipient

/**
  ExecuteActionL
	Obtain the input parameters
	1.	sendAsMessage
	2.	recipientAddress
	3.	alias  (Default value implies empty string)
	4. recipientAddress1
	5.	recipientType 
	IF alias for recipient address is provided as input 
	Call RSendAsMessage::AddRecipient (const TDesC& aAddress, const TDesC& aAlias, 
	TSendAsRecipientType aRecipientType) passing recipientAddress, alias and
	recipientType as input parameters
    ELSE 
	Call RSendAsMessage::AddRecipient (const TDesC& aAddress, TSendAsRecipientType aRecipientType) passing recipientAddress and recipientType as input parameters

  @internalTechnology 
  @pre    None
  @post   None
  @leave  System wide errors
*/
void CMtfTestActionSendAsAddMultipleRecipient::ExecuteActionL()
	{
	if((TestCase().TestStepResult()) == EPass)
		{
		TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSendAsAddMultipleRecipient);

		// Get test action input parameters
		RSendAsMessage sendAsMessage = ObtainValueParameterL<RSendAsMessage>(TestCase(),
											ActionParameters().Parameter(0));

		HBufC*  recipientAddress	 = ObtainParameterReferenceL<HBufC>(TestCase(),
											ActionParameters().Parameter(1), NULL);


		HBufC* alias				 = ObtainParameterReferenceL<HBufC>(TestCase(),
											ActionParameters().Parameter(2), NULL);

		
		RSendAsMessage::TSendAsRecipientType recipientType	
									 = ObtainValueParameterL<RSendAsMessage::TSendAsRecipientType>(TestCase(),
											ActionParameters().Parameter(3));

		TUid msgTypeId				 =  ObtainValueParameterL<TUid>(TestCase(),
											ActionParameters().Parameter(4));
											
		TInt expectedErr			 =  ObtainValueParameterL<TInt>(TestCase(),
											ActionParameters().Parameter(5));
		//Get the second recipient address
		HBufC*  recipientAddress1	 = ObtainParameterReferenceL<HBufC>(TestCase(),
											ActionParameters().Parameter(6), NULL);
										
		TInt err = KErrNone;
		TBuf16<3> btAddress;
						

		if(recipientAddress == NULL)
			{
			if( msgTypeId.operator == (KUidMsgTypeSMTP))
				{
				TMsvId paramServiceId = ObtainValueParameterL<TMsvId>(TestCase(), ActionParameters().Parameter(7), 0);
				CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
				CleanupStack::PushL(settings);
		 		
		 		CEmailAccounts* accounts = CEmailAccounts::NewLC();
		 		TSmtpAccount smtpAccount;
		 		accounts->GetSmtpAccountL(paramServiceId, smtpAccount);
				accounts->LoadSmtpSettingsL(smtpAccount, *settings);
				CleanupStack::PopAndDestroy(accounts);
				
				recipientAddress=settings->EmailAddress().AllocL();
				CleanupStack::PopAndDestroy(settings);
				}
			else
				{
				TestCase().ERR_PRINTF1(_L("Recipient address is not provided"));
				TestCase().SetTestStepResult(EFail);
				}
			}
		else
			{
			if( msgTypeId.operator == (KUidMsgTypeBt))
				{
				CMtfTestActionUtilsMessage::FormatBtRecipientAddress(*recipientAddress, btAddress);
				}
			}
		if((TestCase().TestStepResult()) == EPass)
			{
			if(alias == NULL )
				{
				if( msgTypeId.operator == (KUidMsgTypeBt))
					{
					TRAP(err,sendAsMessage.AddRecipientL(btAddress, recipientType));
					}
				else
					{
					TRAP(err,sendAsMessage.AddRecipientL(*recipientAddress, recipientType));
					TRAP(err, sendAsMessage.AddRecipientL(*recipientAddress1,  recipientType));
					}
				if(err == expectedErr)
					{
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:101,代码来源:CMtfTestActionSendAsAddMultipleRecipient.cpp

示例10: doTestStepL

/**
doTestStepL()
Populate the default POP and SMTP settings, Load the settings of the account 
created with the default settings, and compares the settings objects.
The test passes if all the settings objects match else it fails.

@return
Returns the test step result
*/
TVerdict CT_MsgVerifyPopSettings::doTestStepL()
	{
	INFO_PRINTF1(_L("Test Step: VerifyPopSettings"));
	// Read the Pop account name from the ini file
	TPtrC popAccountName;
	if(!GetStringFromConfig(ConfigSection(), KPopAccountName, popAccountName))
		{
		ERR_PRINTF1(_L("PopAccount Name is not specified"));
		SetTestStepResult(EFail);
		}
	
	else
		{
		// Retrieving the Pop service Id for the given Pop account
		TMsvId popServiceId = CT_MsgUtilsCentralRepository::GetPopServiceIdL((TDes&)popAccountName);
		INFO_PRINTF2(_L("Pop service id is %d"),popServiceId);
		
		if(popServiceId == KMsvNullIndexEntryId)
			{
			ERR_PRINTF1(_L("Invalid POP account name specified"));
			SetTestStepResult(EFail);
			}
		else
			{
			CEmailAccounts* emailAccounts = CEmailAccounts::NewLC();
	
			CImPop3Settings* popSettings1 = new(ELeave) CImPop3Settings();
			CleanupStack::PushL(popSettings1);
			
			CImIAPPreferences* popIapPrefs1 = CImIAPPreferences::NewLC();
			
			CImSmtpSettings* smtpSettings1 = new(ELeave) CImSmtpSettings();
			CleanupStack::PushL(smtpSettings1);

			CImIAPPreferences* smtpIapPrefs1 = CImIAPPreferences::NewLC();

			emailAccounts->PopulateDefaultPopSettingsL(*popSettings1, *popIapPrefs1);
			emailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings1, *smtpIapPrefs1);

			
	
			CImPop3Settings* popSettings2 = new(ELeave) CImPop3Settings();
			CleanupStack::PushL(popSettings2);
			
			CImIAPPreferences* popIapPrefs2 = CImIAPPreferences::NewLC();
			
			CImSmtpSettings* smtpSettings2 = new(ELeave) CImSmtpSettings();
			CleanupStack::PushL(smtpSettings2);

			CImIAPPreferences* smtpIapPrefs2 = CImIAPPreferences::NewLC();

			TPopAccount popAccount;
			emailAccounts->GetPopAccountL(popServiceId, popAccount);
			emailAccounts->LoadPopSettingsL(popAccount, *popSettings2);
			emailAccounts->LoadPopIapSettingsL(popAccount, *popIapPrefs2);
			
			TSmtpAccount smtpAccount;
			emailAccounts->GetSmtpAccountL(popAccount.iSmtpService, smtpAccount);
			emailAccounts->LoadSmtpSettingsL(smtpAccount, *smtpSettings2);
			emailAccounts->LoadSmtpIapSettingsL(smtpAccount, *smtpIapPrefs2);

			TVerdict result = EPass;
			if (!(*popSettings1 == *popSettings2))   
				{
				// failed
				ERR_PRINTF1(_L("Pop3 Settings objects do not match !"));
				result = EFail;
				}
			else if (!(*smtpSettings1 == *smtpSettings2))
				{
				// failed
				ERR_PRINTF1(_L("SMTP Settings objects do not match !"));
				result = EFail;
				}
			else if (!CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(*popIapPrefs1, *popIapPrefs2))
				{
				// failed
				ERR_PRINTF1(_L("Pop3 IAP Preference objects do not match !"));
				result = EFail;
				}
			else if (!CT_MsgUtilsReadEmailSettingsFromConfigFile::CompareIapPrefs(*smtpIapPrefs1, *smtpIapPrefs2))
				{
				// failed
				ERR_PRINTF1(_L("SMTP IAP Preference objects do not match !"));
				result = EFail;
				}
			SetTestStepResult(result);
			CleanupStack::PopAndDestroy(9,emailAccounts);
			}
		}
	return TestStepResult();
//.........这里部分代码省略.........
开发者ID:fedor4ever,项目名称:default,代码行数:101,代码来源:T_VerifyPopSettings.cpp

示例11: ExecuteActionL


//.........这里部分代码省略.........
	TBuf8<1> aChar;				// To read one character from the file
	TBool finished = FALSE;

	recvConvert->ResetL();

	// Parse each line from the 

	do {
		line.FillZ();
		line.SetLength(0);
		// Read one line from email file
		do {
			file.Read(aChar, 1);
			if(aChar.Length())
				{
				line.Append(aChar);
				}
			else
				{
				finished = TRUE;
				}
			} while(aChar.Length() && aChar[0] != 0x0A);
			
			if(!line.Length())
				{
				break;
				}
			// Parse the line for the fields of the email and store them
			recvConvert->ParseNextFieldL(line);
		} while(!finished);


	/****************************************************************************
	 Complete the message creation by setting all the required fields and 
	 storing the email on to the message store.
	 The created email's ID is returned by MessageCompelteL function
	****************************************************************************/
	TMsvId paramMessageId;
	paramMessageId = recvConvert->MessageCompleteL();

	if(paramMessageId == 0)
		{
		User::Leave(KErrUnknown);
		}

	file.Close();
	CleanupStack::PopAndDestroy(recvConvert);
	
	if(overrideAddress)
		{
#ifndef __MESSAGING_API_V2__		
		entry->SetEntryL(paramServiceId);
		CMsvStore* store=entry->ReadStoreL();
		CleanupStack::PushL(store);
#endif		
		CImSmtpSettings* settings= new(ELeave) CImSmtpSettings();
		CleanupStack::PushL(settings);
#ifdef __MESSAGING_API_V2__
 		CEmailAccounts* accounts = CEmailAccounts::NewLC();
 		TSmtpAccount smtpAccount;
 		accounts->GetSmtpAccountL(paramServiceId, smtpAccount);
		accounts->LoadSmtpSettingsL(smtpAccount, *settings);
		CleanupStack::PopAndDestroy();
#else		
		settings->RestoreL(*store);
		CleanupStack::PopAndDestroy();
#endif		
		HBufC* emailAddress=settings->EmailAddress().AllocL();
		CleanupStack::PopAndDestroy();
		CleanupStack::PushL(emailAddress);
		entry->SetEntryL(paramMessageId);
#ifdef __MESSAGING_API_V2__
		CMsvStore* store=entry->EditStoreL();
#else
		
		store=entry->EditStoreL();
#endif
		CleanupStack::PushL(store);
		
		CImHeader* header= CImHeader::NewLC();
		header->RestoreL(*store);
		
		header->ToRecipients().Reset();
		header->ToRecipients().AppendL(*emailAddress);
		
		header->StoreL(*store);
		store->CommitL();
		
		CleanupStack::PopAndDestroy(3,emailAddress);
		}
	
	CleanupStack::PopAndDestroy(entry);

	TestCase().INFO_PRINTF2(_L("Created a email from file %S"),&fileName);

	StoreParameterL<TMsvId>(TestCase(),paramMessageId,ActionParameters().Parameter(4));
	fs.Close();
	TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCreateSmtpMessageFromEmailFile);
	TestCase().ActionCompletedL(*this);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:101,代码来源:CMtfTestActionCreateSmtpMessageFromEmailFile.cpp


注:本文中的CEmailAccounts::LoadSmtpSettingsL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。