Results 1 to 5 of 5

Thread: Qt Messaging

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4

    Default Qt Messaging

    Hi! I'm writing one program for sending email. I saw some examples and took next code from one
    Qt Code:
    1. QMessageService service;
    2. bool b;
    3.  
    4.  
    5. QString accountName("111@gmail.com");
    6. QMessage message;
    7. message.setType(QMessage::Email);
    8. message.setParentAccountId(QMessageAccountId(accountName));
    9.  
    10. QString to("222@gmail.com");
    11. QMessageAddress addr(QMessageAddress::Email,to);
    12. message.setTo(addr);
    13.  
    14. QString subject("first message");
    15. message.setSubject(subject);
    16.  
    17. QString text("Hello");
    18. message.setBody(text);
    19.  
    20. b = message.parentAccountId().isValid();
    21. if (service.send(message))
    22. {
    23. QMessageBox::information(0,tr("Success"),tr("Email sent successfully!"));
    24. hide();
    25. }
    26. else
    27. {
    28. QMessageBox::warning(0, tr("Failed"), tr("Unable to send message. Valid: %1").arg(b));
    29.  
    30. }
    To copy to clipboard, switch view to plain text mode 

    When i try to send message on my device it all the times say me "Unable to send message.Valid: 1". I don't know where can be mistake...should you give me any ideas?
    Last edited by high_flyer; 28th September 2011 at 15:38. Reason: code tags

Similar Threads

  1. Replies: 0
    Last Post: 31st January 2011, 12:51
  2. Qt and Windows messaging
    By bnilsson in forum Qt Programming
    Replies: 1
    Last Post: 6th January 2010, 16:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.