Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Mobility Messaging - Send E-mail with "text/html" MIME type
Forum Updated to NodeBB v4.3 + New Features

Mobility Messaging - Send E-mail with "text/html" MIME type

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gronerth
    wrote on last edited by
    #1

    Hello Everyone!!!

    I was trying to sell an e-mail with html through Qt Mobility using the Messaging Module, I have done something like this:

    @QMessageService* serviceAction = new QMessageService();
    QMessage message;
    message.setTo(QMessageAddress(QMessageAddress::Email,"tgronerth@gmail.com"));
    message.setSubject("QtMobility Messaging");
    QString htmlBody("<html><head><title>Prueba</title></head><body><h2 align=center>%1</h2><hr>%2</body></html>");

    message.setBody(htmlBody.arg("hola!").arg("Cómo estás?????"),"text/html"); // here i have specified the mime type to "text/html"

    QMessageManager manager;

    foreach (const QMessageAccountId &id;, manager.queryAccounts()) {
        QMessageAccount account(id);
        QString nameStr(account.name());
        qDebug() << "name: " << nameStr;
        if(nameStr=="Mail for Exchange")
        {
            message.setType(QMessage::Email);
            message.setParentAccountId(id);
        }
        qDebug() << "id:" << id.isValid() << " string:" << id.toString();
    }
    

    qDebug() << serviceAction->send(message);
    delete serviceAction;@

    But when the e-mail arrives, it shows the html as a text plain like this:

    <html><head><title>Prueba</title></head><body><h2 align=center>hola!</h2><hr>Cómo estás?????</body></html>

    I am using Qt Mobility 1.1.3, can anyone tell me what i am doing wrong?

    Thanks in advance!


    JETG

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chuck Gao
      wrote on last edited by
      #2

      [quote author="gronerth" date="1310595503"]Hello Everyone!!!
      But when the e-mail arrives, it shows the html as a text plain like this:
      [/quote]

      How do you show the email message?

      Chuck

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gronerth
        wrote on last edited by
        #3

        [quote author="Chuck Gao" date="1311951392"]

        How do you show the email message?

        [/quote]

        What do you mean of how do i show?...do you mean how do i see the received message? If it does, i see the received message in the inbox of the gmail, I also have tested with hotmail..


        JETG

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved