Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Sending mail via smtp.gmail.com in QT on OSX
QtWS25 Last Chance

Sending mail via smtp.gmail.com in QT on OSX

Scheduled Pinned Locked Moved General and Desktop
smtposxsslmac
3 Posts 2 Posters 2.4k Views
  • 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.
  • R Offline
    R Offline
    Rida
    wrote on 18 Sept 2015, 15:54 last edited by Rida
    #1

    Hi,

    I'm trying to do something that should be quite straightforward.
    My application should send an e-mail to a list of addresses. Since it will be a simple message containing some text I thought smtp would be enough to get the job done, and google provides an smtp server (smtp.gmail.com)

    I based my code on an example I found online which was very helpful.
    http://morf.lv/modules.php?name=tutorials&lasit=20

    When I tested my code everything seemed to go well until I got to the point where the connection was supposed to be made my debug output shows this:

    qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_client_callback
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
    qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
    qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
    qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
    stateChanged  QAbstractSocket::HostLookupState
    stateChanged  QAbstractSocket::ConnectingState
    stateChanged  QAbstractSocket::ConnectedState
    Connected 
    error  QAbstractSocket::SocketError(13)
    stateChanged  QAbstractSocket::ClosingState
    stateChanged  QAbstractSocket::UnconnectedState
    disconneted
    error  "The issuer certificate of a locally looked up certificate could not be found"
    

    I thought maybe the fault was in my code so I tested the example provided online and got the same issue.
    I googled for a while and found out that OSX has some issues with OpenSSL, and that's why the connection can't be made.
    I have absolutely no experience with SSL or anything like it so I was wondering if anyone could tell me how to work around this issue on mac.
    Any help would be much appreciated.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Sept 2015, 20:13 last edited by
      #2

      Hi,

      This bug report might interest you

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply 18 Sept 2015, 21:58
      0
      • S SGaist
        18 Sept 2015, 20:13

        Hi,

        This bug report might interest you

        R Offline
        R Offline
        Rida
        wrote on 18 Sept 2015, 21:58 last edited by
        #3

        @SGaist

        Thank you very much, I used the work-around they proposed
        (storing a copy of the certificate in the local resources of the app & adding that to the default CACertificate list before opening the socket)
        I'm afraid this won't be a clean long term solution though (the certificate will stay valid for a while, but eventually expires I guess).
        If anyone has any idea's for a more clean/permanent solution I'm very much open to suggestions.
        In the mean time this will have to do.
        Thanks again, I appreciate the comment

        1 Reply Last reply
        0

        2/3

        18 Sept 2015, 20:13

        • Login

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