×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Sending SMS or Email in QML

    Ciao,

    I am trying to figure out how to send an SMS and Email with QML for Nokia N9

    I found the following call:
    Qt.openUrlExternally("sms:12345")

    but I would like to add the message instead of the number:
    Qt.openUrlExternally("sms:12345?body=ciao")

    any ideas?
    Also for email, cannot find if a call such as below exists
    Qt.openUrlExternally("email:")

    Alessandro
    Last edited by biskero; 2011-11-06 at 15:37.

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Sending SMS or Email in QML

    Ciao,

    an update, the following call for email works:
    Qt.openUrlExternally("mailto:?subject=Ciao&body=it works")

    Can't figure out the SMS call !
    Alessandro

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Sending SMS or Email in QML

    Probably..

    Code:
    Qt.openUrlExternally("sms:123456789" + "?body=" + "bodytext")

  4. #4
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Sending SMS or Email in QML

    Ciao Savaj,

    it does not work. As the above code, it puts everything in the phone # field !
    Alessandro
    Last edited by biskero; 2011-11-07 at 13:49.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    13

    Re: Sending SMS or Email in QML

    Hey, this Qt.openUrlExternally("sms:123456789" + "?body=" + "bodytext") worked fine on my Symbian N8 phone. Bodytext was correctly placed into message body. Thanks for the hint!

  6. #6
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Sending SMS or Email in QML

    Ciao,

    which import/include did you add to your project? Maybe I am missing something.

    For the Nokia N9 it puts 123456789?body=bodytext in the phone number field !
    I am surprise it does not work since SMS is probably the most common feature that should work out of the box!

    Alessandro

  7. #7
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Sending SMS or Email in QML

    Hi,

    Please check this out:
    http://www.developer.nokia.com/bugs/show_bug.cgi?id=251

    If I understood outcome of that bug report correctly, only way to send a SMS with body text is to use QMessage.

    -Ilkka

  8. #8
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Sending SMS or Email in QML

    Ciao,

    looks like that is the case, so I followed this article:
    http://www.developer.nokia.com/Commu...Shelper_Plugin

    everything works fine exect that the SMS is composed without opening the Phone Messaging application on top of my application.
    Is there a way to open the Messaging application so that the user can select the who to send the SMS to?
    I mean is there a way to set the focus on the Phone Messaging app?

    Alessandro

  9. #9
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Sending SMS or Email in QML

    Hi Alessandro,

    Sorry, I couldn't find a way to do it, but could you submit this question to ticket based support?
    Then our dedicated Meego experts could investigate it thoroughly.
    http://www.developer.nokia.com/Resources/Support/

    Br,
    Ilkka

  10. #10
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Sending SMS or Email in QML

    Ciao Ilkka,

    no problem, I fix the issues and everything is working fine.
    Thanks for the support!

    Alessandro

  11. #11
    Regular Contributor
    Join Date
    Jan 2009
    Location
    North Texas, USA
    Posts
    466

    Re: Sending SMS or Email in QML

    Quote Originally Posted by biskero View Post
    Ciao Ilkka,

    no problem, I fix the issues and everything is working fine.
    Thanks for the support!

    Alessandro
    Can you share your solution?

  12. #12
    Nokia Developer Champion
    Join Date
    Apr 2005
    Location
    Boston
    Posts
    517

    Re: Sending SMS or Email in QML

    Ciao,

    sure. So I added the smshelper example to my project.
    The problem with this example is that the SMS composer does not pop-up, as the SMS is created and sent (if the phone# is valid).
    So in the smshelper.cpp I commented out and added the following lines:

    sms.setType(QMessage::Sms);
    //sms.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Sms));
    //sms.setTo(QMessageAddress(QMessageAddress::Phone, phonenumber));
    sms.setBody(message);
    pMessageManager.compose(sms);

    In my project is the user that enters the phone number so I am not using it in my app.
    The compose(sms) opens the SMS composer when you invoke the method as shown in the smshelper example.

    Alessandro

  13. #13
    Regular Contributor
    Join Date
    Jan 2009
    Location
    North Texas, USA
    Posts
    466

    Re: Sending SMS or Email in QML

    Thanks Alessandro!

Similar Threads

  1. sending email via Qt
    By wenz in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2010-10-05, 16:25
  2. How to sending Email
    By eya360 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2008-05-17, 06:56
  3. sending email
    By Bill_Murray in forum Mobile Java General
    Replies: 8
    Last Post: 2005-09-26, 13:04
  4. sending an email
    By Bill_Murray in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2005-09-25, 16:13
  5. sending email
    By Bill_Murray in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-09-14, 15:27

Posting Permissions

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