×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    PLEASE HELP!! How to send an e-mail with the given address?

    Greetings,

    the below code is a function from a "emailpop3" example application I found in SDK. I tried to get rid of the UI part and enter the e-mail address and the attachment names myself. It appears to be harder than I thought and it is even harder to debug it since I don't know where exactly it crashes and why.(the application just exits, or no message received on the server)

    This is what I tried to do after the clientMtm->CreateMessage():

    _LIT(myaddress, "somebody@mydomainname.com");
    clientMtm->AddAddresseeL(myaddress);

    it does not work. :-(
    It does not even initialize the address inside the UI if I leave it.

    How to send an e-mail with the given address and given attached file (image file from the cell phone, etc.)?


    I don't know what to do. Please, help.

    Alex



    void CEpop3Engine::CreateEmailL()
    {
    // Set engine state to current activity
    iEngineState = ECreating;

    // Get a client registry for the current session
    CClientMtmRegistry* mtmReg = CClientMtmRegistry::NewL( *iMsvSession );
    CleanupStack::PushL( mtmReg );

    // Get a new client MTM for the SMTP protocol from the registry
    CSmtpClientMtm* clientMtm = (CSmtpClientMtm*)mtmReg->NewMtmL( KUidMsgTypeSMTP );
    CleanupStack::PushL( clientMtm );

    // Switch context to a draft entry - we are creating a new message
    clientMtm->SwitchCurrentEntryL( KMsvDraftEntryId );

    // Get the message server ID for a SMTP service
    TMsvId service( FindServiceL( KUidMsgTypeSMTP ) );

    // Create the new message
    clientMtm->CreateMessageL( service );

    // Get an UI MTM registry for the current session
    CMtmUiRegistry* mtmUiReg = CMtmUiRegistry::NewL( *iMsvSession );
    CleanupStack::PushL( mtmUiReg );

    // Get a new UI MTM from the registry
    CBaseMtmUi* mtmUi = mtmUiReg->NewMtmUiL( *clientMtm );
    CleanupStack::PushL( mtmUi );


    // Create a CMsvOperationWait object. This is used to
    // run an asynchronous operation (EditL) synchronously.
    CMsvOperationWait* wait = CMsvOperationWait::NewLC();
    wait->iStatus = KRequestPending;

    // Call the UI MTM EditL method to open the current
    // message for editing
    CMsvOperation* op = mtmUi->EditL( wait->iStatus );
    wait->Start();
    CleanupStack::PushL( op );

    // Start the asynchronous operation, return when complete
    CActiveScheduler::Start(); // returns when wait completes
    CleanupStack::PopAndDestroy( 2 ); // op, wait

    // The CMsvOperationWait section of the code ends here


    CleanupStack::PopAndDestroy( 4 ); // mtmUi, mtmUiReg, clientMtm, mtmReg

    // We are again in the EReady state
    iEngineState = EReady;
    }

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: PLEASE HELP!! How to send an e-mail with the given address?

    I will let someelse try to find the bugs, however I did write it using the RSendAsMessage API in my blog last year

    http://blogs.forum.nokia.com/blog/pa...rsendasmessage
    http://blogs.forum.nokia.com/blog/pa...-email-address

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    Re: PLEASE HELP!! How to send an e-mail with the given address?

    Unfortunately, it doesn't help. The SDK I have has neither RSendAsMessage nor RSendAs. I think I am using 8.0a and there is no time to upgrade.

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: PLEASE HELP!! How to send an e-mail with the given address?

    The class you're looking for is CSendAs. Do a search on CSendAs on this Discussion Board and I'm sure you will find plenty of useful information.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    6

    Re: PLEASE HELP!! How to send an e-mail with the given address?

    Believe it or not, I did look at the resources you listed.
    Class CSendAs was used in some of the examples. Unfortunately it required some class CMsvPop3Utils that I don't have. (the thread with that example contained a dozen of other people giving their e-mail addresses and asking for his class). Where can I find this CMsvPop3Utils to make my dreams come true?

Similar Threads

  1. Binding to Remote IP address Fails with -1
    By girish_1978 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-08-08, 20:36
  2. Binding to Remote IP address Fails with -1
    By girish_1978 in forum Symbian C++
    Replies: 0
    Last Post: 2006-08-04, 20:29
  3. Can i send a address from server to client address
    By chinazou305 in forum Symbian C++
    Replies: 2
    Last Post: 2003-11-28, 03:56
  4. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46
  5. How to send an e mail?
    By hanefiz in forum General Messaging
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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