340 CleanupStack::PopAndDestroy(pImSmtpSettings); |
340 CleanupStack::PopAndDestroy(pImSmtpSettings); |
341 CleanupStack::PopAndDestroy(pImPop3Settings); |
341 CleanupStack::PopAndDestroy(pImPop3Settings); |
342 CleanupStack::PopAndDestroy(pImIAPPreferences); |
342 CleanupStack::PopAndDestroy(pImIAPPreferences); |
343 CleanupStack::PopAndDestroy(pEmailAccounts); |
343 CleanupStack::PopAndDestroy(pEmailAccounts); |
344 |
344 |
345 return QMessageAccountId(addIdPrefix(QString::number(popAccount.iPopService))); |
345 return QMessageAccountId(addIdPrefix(QString::number(popAccount.iPopService), SymbianHelpers::EngineTypeMTM)); |
346 } |
346 } |
347 |
347 |
348 QMessageAccountId createPopAndSmtpAccount(const TDesC& accountName, const TDesC& fromAddress) |
348 QMessageAccountId createPopAndSmtpAccount(const TDesC& accountName, const TDesC& fromAddress) |
349 { |
349 { |
350 QMessageAccountId retVal; |
350 QMessageAccountId retVal; |
456 pImSmtpSettings->SetEmailAliasL(KEmailAlias); |
456 pImSmtpSettings->SetEmailAliasL(KEmailAlias); |
457 pImSmtpSettings->SetEmailAddressL(fromAddress); |
457 pImSmtpSettings->SetEmailAddressL(fromAddress); |
458 pImSmtpSettings->SetReplyToAddressL(fromAddress); |
458 pImSmtpSettings->SetReplyToAddressL(fromAddress); |
459 pImSmtpSettings->SetReceiptAddressL(fromAddress); |
459 pImSmtpSettings->SetReceiptAddressL(fromAddress); |
460 pImSmtpSettings->SetPort(25); |
460 pImSmtpSettings->SetPort(25); |
461 pEmailAccounts->CreateSmtpAccountL(imapAccount, *pImSmtpSettings, *pImIAPPreferences, EFalse); |
461 TSmtpAccount smtpAccount = pEmailAccounts->CreateSmtpAccountL(imapAccount, *pImSmtpSettings, *pImIAPPreferences, EFalse); |
|
462 |
|
463 TSmtpAccount defaultAccount; |
|
464 if (pEmailAccounts->DefaultSmtpAccountL(defaultAccount) == KErrNotFound) |
|
465 { |
|
466 pEmailAccounts->SetDefaultSmtpAccountL(smtpAccount); |
|
467 } |
462 |
468 |
463 CleanupStack::PopAndDestroy(pImSmtpSettings); |
469 CleanupStack::PopAndDestroy(pImSmtpSettings); |
464 CleanupStack::PopAndDestroy(pImap4Settings); |
470 CleanupStack::PopAndDestroy(pImap4Settings); |
465 CleanupStack::PopAndDestroy(pImIAPPreferences); |
471 CleanupStack::PopAndDestroy(pImIAPPreferences); |
466 CleanupStack::PopAndDestroy(pEmailAccounts); |
472 CleanupStack::PopAndDestroy(pEmailAccounts); |
467 |
473 |
468 return QMessageAccountId(addIdPrefix(QString::number(imapAccount.iImapService))); |
474 return QMessageAccountId(addIdPrefix(QString::number(imapAccount.iImapService), SymbianHelpers::EngineTypeMTM)); |
469 } |
475 } |
470 |
476 |
471 QMessageAccountId createImapAndSmtpAccount(const TDesC& accountName, const TDesC& fromAddress) |
477 QMessageAccountId createImapAndSmtpAccount(const TDesC& accountName, const TDesC& fromAddress) |
472 { |
478 { |
473 QMessageAccountId retVal; |
479 QMessageAccountId retVal; |
518 QString nullString = "00000000"; |
524 QString nullString = "00000000"; |
519 QString serviceEntryIdString = QString::number(account.iRelatedService); |
525 QString serviceEntryIdString = QString::number(account.iRelatedService); |
520 serviceEntryIdString = nullString.left(8-serviceEntryIdString.length()) + serviceEntryIdString; |
526 serviceEntryIdString = nullString.left(8-serviceEntryIdString.length()) + serviceEntryIdString; |
521 QString folderIdString = QString::number(folderId); |
527 QString folderIdString = QString::number(folderId); |
522 folderIdString = nullString.left(8-folderIdString.length()) + folderIdString; |
528 folderIdString = nullString.left(8-folderIdString.length()) + folderIdString; |
523 return addIdPrefix(serviceEntryIdString+folderIdString); |
529 return addIdPrefix(serviceEntryIdString+folderIdString, SymbianHelpers::EngineTypeMTM); |
524 } |
530 } |
525 |
531 |
526 QMessageFolderId addFolder(const Parameters ¶ms) |
532 QMessageFolderId addFolder(const Parameters ¶ms) |
527 { |
533 { |
528 QString accountName(params["parentAccountName"]); |
534 QString accountName(params["parentAccountName"]); |