×

Discussion Board

Results 1 to 3 of 3

Threaded View

  1. #1
    Regular Contributor
    Join Date
    Oct 2007
    Location
    India
    Posts
    349

    Question How to invoke Default Email Client on Symbian based Devices using Qt API?

    Email:
    There may be two ways to send mail.
    1) Using QtMobility API
    2) Using Defualt EMail Client

    Code using QtMobility

    //Headers
    #include <QMessage>
    #include <QMessageService>

    .pro will contain -> MOBILITY += messaging

    // Actual Code
    QMessageService* msgAction = new QMessageService(this);
    QMessage msg;
    msg.setType(QMessage::Email);
    msg.setTo(QMessageAddress(QMessageAddress::Email,"narendardiscover@gmail.com"));
    msg.setSubject("Test Subject");
    msg.setBody("Welcome to Home");
    QStringList attachments;
    attachments.append(":/res/icon.png");
    msg.appendAttachments(attachments);
    //Send email message
    qDebug()<<"Sending Status = "<<msgAction->send(msg);

    Code using Default Email Client

    //Headers
    #include <QDesktopServices>
    #include <QUrl>

    //Actual Code
    QDesktopServices:penUrl(QUrl(tr("mailto:narendardiscover@gmail?subject=Test Subject&body=Welcome to Home")));

    // Capability used for both ways
    Symbian:TARGET.CAPABILITY += NetworkServices
    Last edited by narendar_discover; 2011-04-21 at 09:20.

Similar Threads

  1. Sending image programmatically, fallback using default email client?
    By tvinke in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-10-01, 14:20
  2. Replies: 1
    Last Post: 2006-08-18, 09:03

Posting Permissions

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