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 a nemail
Qt 6.11 is out! See what's new in the release blog

Sending a nemail

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.0k 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.
  • C Offline
    C Offline
    cedrix
    wrote on last edited by
    #1

    Hello,

    I can't find an easy way to send an email with an image with Qt5. I found out this:
    http://www.developer.nokia.com/Community/Wiki/Send_a_new_email_in_Qt
    But this classes was available on Qt mobility and is not available anymore. I also found out a solution with Qxt, but I am trying to lower my project dependencies.
    Anyone know how I could do that?

    Thanks in advance,

    Cédric

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      .... I',m not going to write my post which I already wrote today morning...
      Qt doesn't have standard methods to send mails. use 3rd libraries like Qxt(if you trying to lower dependencies, simply copy the code of SMTP class from Qxt directly to your project. it is about 20-30 lines) or simply write your own Class, sending E-mail over the SMTP with Qt is about 10-15 lines of code... There is enough examples on the net...

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cedrix
        wrote on last edited by
        #3

        Ok so I took the Qxt classes and put it my project. I change of qt version and os very often. So that's why I lower the dependencies. For instance Qxt always worked well with me...until Qt5 was released. I couldn't compile it from the first time and didn't wanted to spend hours to search how to fixe that.
        Also I tried some smtp exemples from the net. They are not always reliable. They work in easy case but not every one and then issues pop...and it's a lot of time to udnerstand how that works and why it bug.
        In order to stay productive, I think taking the code of Qxt is the best thing to do. But it's not 30 lines of code but about 3000 lines spread in 12 files =) Here is a linux script to retrieve it. The variable commit contains the git revision id.
        @commit=3a84efc4860740f5665594ef7d454bd2de8ccd96
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/core/qxtglobal.h
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/core/qxtglobal.cpp
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/core/qxthmac.h
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/core/qxthmac.cpp
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtmailattachment.h
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtmailattachment.cpp
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtmailmessage.h
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtmailmessage.cpp
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtsmtp.h
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtsmtp.cpp
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtmail_p.h
        wget http://dev.libqxt.org/libqxt/raw/$commit/src/network/qxtsmtp_p.h@

        I am curious to know why Qt doesn't have standard methods to send mails, and why they started to introduce that in qt mobility and finally removed it? Did they already say something about that?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AcerExtensa
          wrote on last edited by
          #4

          I think because there is many different ways to do it on different OSs, and actually there is no standardized way for all OSs and each user can decide by itself which program he would like to use for mail synchronization... And implementing SMTP protocol with Qt is very very simple, each beginner can do that, but not every one need it directly in Qt library...

          If you delete all abstraction in Qxt classes it size will decrease drastically!
          P.S.: POP3 takes 35 lines of plain C code with "include" lines on windows ;) It can be even less with Qt

          God is Real unless explicitly declared as Integer.

          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