Here is a code, how I create the folder on My Folders:

TMsvSelectionOrdering ordering;
CMsvEntry* iMsvEntry = CMsvEntry::NewL(*iSession,
KMsvMyFoldersEntryIdValue, ordering);

TTime date;
date.HomeTime();
_LIT(folderName, "Folder 2");

TMsvEntry folderentry;
folderentry.iType = KUidMsvFolderEntry;
folderentry.iMtm = KUidMsvLocalServiceMtm;
folderentry.iDetails.Set(folderName);
folderentry.iDescription.Set(folderName);
folderentry.iServiceId = iSmsMtm->ServiceId();
folderentry.iSize = sizeof(folderentry);
folderentry.iDate = date;
folderentry.SetStandardFolder(ETrue);
folderentry.SetVisible(ETrue);

iMsvEntry->CreateL(folderentry);
delete iMsvEntry;

The folder creates Ok, but when I try to delete this folder on messaging app, it cannot be deleted, there's access denied error. What is the problem? What I'm doing wrong? What should I add to my code?