You Are Here:

Community: Developer Discussion Boards

#1 Old Crosspost: MsvOperation does not finish while sending email - 2006-03-29, 10:50

Join Date: May 2003
Posts: 4
lukas.pustina
Offline
Registered User
Hey folks,

this is a cross post from the Symbian C++ Network forum. Because my problem is related to Python as well, I decided to post it in this group too.

I wrote a messaging library that uses the Symbian Messaging System to send SMS, MMS, and email. The library is used as a backend for some python scripts.
While sending SMS and MMS works like a charm, sending emails is giving me headaches. I'm sure you can help.

The problem is that the CMsvOperation created by CBaseMtmUi::CopyToL never finishes. The symptom is as follows:
- the msg is created
- and sent
- during this, an infobox pops up saying "Establishing connection via <ASP>" (translation from German - so it might be different in the English version) and never disappears. The python console is blocked. When I use python over a BlueTooth connection I still can enter commands, but after executing a CMsvOperation::Cancel the whole python process dies.

I'm glad for any help,
thanks in advance

Lukas

My sending code:


TInt CxMSBackend::sendSMTPL() {
CLog::logL( _L("CxMSBackend::sendSMTPL +") );

CSmtpClientMtm* smtpMtm = STATIC_CAST(CSmtpClientMtm*, iMtm );
CMtmUiRegistry* mtmUiRegistry = CMtmUiRegistry::NewL(smtpMtm->Session(), 1000000);
CBaseMtmUi* baseMtmUi = mtmUiRegistry->NewMtmUiL(*smtpMtm);

TMsvSelectionOrdering ordering;
ordering.SetShowInvisibleEntries(ETrue);// SMTP services are invisible
ordering.SetGroupByMtm(ETrue);
CMsvEntry* entry1 = CMsvEntry::NewL(*iSession, KMsvRootIndexEntryId, ordering );
CMsvEntrySelection* rootChildren = entry1->ChildrenWithMtmL(KUidMsgTypeSMTP);

if (rootChildren->Count() == 0)
return KErrNotFound;

CMsvEntry* entry2 = iSession->GetEntryL( KMsvGlobalOutBoxIndexEntryId );
smtpMtm->SwitchCurrentEntryL( entry2->EntryId() );
smtpMtm->CreateMessageL((*rootChildren)[0]);

CImSmtpSettings* set = new(ELeave) CImSmtpSettings();
set->CopyL(smtpMtm->Settings());
smtpMtm->AddAddresseeL(iRecipient->Des());
smtpMtm->SetSubjectL(iSubject->Des());
smtpMtm->Body().InsertL(0, iBody->Des());
set->SetServerAddressL( iSmtpServer->Des() ); // Seems to be not supported!
set->SetPort( iSmtpServerPort ); // Seems to be not supported!
set->SetEmailAddressL( iSmtpSenderAdr->Des() ); // Seems to be not supported!
set->SetSendMessageOption(ESendMessageImmediately);
smtpMtm->SetSettingsL(*set);
CMsvEntry* entry3 = &smtpMtm->Entry();
TMsvEntry tMsvEntry = entry3->Entry();
tMsvEntry.SetInPreparation(EFalse);
tMsvEntry.SetScheduled(ETrue);
tMsvEntry.SetSendingState(KMsvSendStateWaiting);
entry3->ChangeL(tMsvEntry);
smtpMtm->SaveMessageL();

CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection;
sel->AppendL(entry3->EntryId());
smtpMtm->SwitchCurrentEntryL(entry3->Entry().iServiceId);

iOperation = baseMtmUi->CopyToL(*sel, iStatus);
SetActive();

SAFE_DEL(sel);
SAFE_DEL(set);
SAFE_DEL(entry3);
SAFE_DEL(entry2);
SAFE_DEL(rootChildren);
SAFE_DEL(entry1);
SAFE_DEL(baseMtmUi);
SAFE_DEL(mtmUiRegistry);

CLog::logL( _L("CxMSBackend::sendSMTPL -") );
return KErrNone;
}
Reply With Quote

#2 Old Re: Crosspost: MsvOperation does not finish while sending email - 2006-03-29, 14:14

Join Date: Aug 2004
Posts: 290
simo.salminen
Offline
Regular Contributor
Take a look your code first and last line:

Code:
CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection;
sel->AppendL(entry3->EntryId());
smtpMtm->SwitchCurrentEntryL(entry3->Entry().iServiceId);

iOperation = baseMtmUi->CopyToL(*sel, iStatus);
SetActive();

SAFE_DEL(sel);
When using async. methods, you should store parameters to instance variables. In this case, by the time the server starts to read your 'sel' data, it is long gone. The server is running in other process, and it reads data from your process using kernel IPC.
Reply With Quote

#3 Old Re: Crosspost: MsvOperation does not finish while sending email - 2006-03-29, 15:54

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Lukas ,

Many people here waiting for a library allowing us sending MMS in pys60 ... Could you share your code library when you have completed it ?
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an image over email jeclarim Python 3 2006-12-15 21:25
CMsvOperation does not finish while sending email lukas.pustina Symbian Networking & Messaging 0 2006-03-28 10:47
Sending a remote email Brucmack General Symbian C++ 0 2005-11-10 10:37
Sending Email over GPRS pankajmahto General Symbian C++ 0 2004-07-29 08:48
Sending Email from SMS - Urgent chiradeep_basu General Messaging 1 2002-09-23 01:35

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia