diff -r 5253a20d2a1e -r a4d6f1ea0416 emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp --- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp Mon Jan 18 20:08:26 2010 +0200 +++ b/emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp Tue Jan 26 11:45:42 2010 +0200 @@ -132,33 +132,26 @@ } CMessageData* messageData = CMessageData::NewLC(); - - if ( mtmUid == KSenduiMtmSmsUid ) - { - // Sending through SMS - - // Copy the one and only attachment into a rich text object - CRichText* msgBody = CreateRichTextFromFileLC(); - - messageData->SetBodyTextL( msgBody ); - - // Send the message using Send Ui - iSendUi->CreateAndSendMessageL( mtmUid, messageData, KMsgBioUidVCard ); - - CleanupStack::PopAndDestroy( msgBody ); - } - else - { - // Not sending through SMS, just pass the attachments - // hardcoded paths removed - messageData->AppendAttachmentL(iTempFileName); - // - - // Send the message using Send Ui - iSendUi->CreateAndSendMessageL( mtmUid, messageData, KMsgBioUidVCard ); - } - + + // + RFs fs; + RFile attachament; + + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + User::LeaveIfError( attachament.Open( fs, iTempFileName, EFileShareAny ) ); + CleanupClosePushL( attachament ); + + messageData->AppendAttachmentHandleL( attachament ); + + // Send the message using Send Ui + iSendUi->CreateAndSendMessageL( mtmUid, messageData, KMsgBioUidVCard ); + + CleanupStack::PopAndDestroy( &attachament ); + CleanupStack::PopAndDestroy( &fs ); CleanupStack::PopAndDestroy( messageData ); + + // DestroyTempFileL(); @@ -223,11 +216,9 @@ // Open the file for reading RFile file; // take away double line break - User::LeaveIfError( - file.Open( - iEikEnv->FsSession(), - iTempFileName, // - EFileRead | EFileStream | EFileShareReadersOnly ) ); + User::LeaveIfError( file.Open( iEikEnv->FsSession(), + iTempFileName, // + EFileRead | EFileStream | EFileShareReadersOnly ) ); // CleanupClosePushL( file );