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. is there anyway to Send Email to someone in Qt?

is there anyway to Send Email to someone in Qt?

Scheduled Pinned Locked Moved Unsolved General and Desktop
48 Posts 12 Posters 26.1k 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.
  • O Offline
    O Offline
    opengpu
    wrote on 24 Apr 2019, 17:09 last edited by
    #1

    is there anyway to Send Email to someone in Qt?
    i know without Qt, it's able to use SMTP to send.
    thank you!

    R 1 Reply Last reply 24 Apr 2019, 17:14
    0
    • O opengpu
      24 Apr 2019, 17:09

      is there anyway to Send Email to someone in Qt?
      i know without Qt, it's able to use SMTP to send.
      thank you!

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 24 Apr 2019, 17:14 last edited by raven-worx
      #2

      @opengpu
      not directly, only with 3rd party libs:
      https://github.com/cutelyst/simple-mail
      https://github.com/bluetiger9/SmtpClient-for-Qt
      ...
      and a SMTP server of course.

      or via IMAP server
      http://trojita.flaska.net/

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      O 3 Replies Last reply 25 Apr 2019, 04:05
      5
      • O Offline
        O Offline
        opengpu
        wrote on 24 Apr 2019, 17:15 last edited by
        #3

        ok, thanks very much.

        1 Reply Last reply
        1
        • K Offline
          K Offline
          Kent-Dorfman
          wrote on 24 Apr 2019, 17:49 last edited by
          #4

          If you want the hardcore dirty path then use Qt to manage the TCP connection, and implement the RFCs to intelligently speak with a mail relay.

          O 1 Reply Last reply 25 Apr 2019, 02:53
          0
          • K Kent-Dorfman
            24 Apr 2019, 17:49

            If you want the hardcore dirty path then use Qt to manage the TCP connection, and implement the RFCs to intelligently speak with a mail relay.

            O Offline
            O Offline
            opengpu
            wrote on 25 Apr 2019, 02:53 last edited by
            #5

            @Kent-Dorfman i just want to send email to someone at specific time.
            eg. when i press a button , send a email to someone.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              opengpu
              wrote on 25 Apr 2019, 02:53 last edited by
              #6

              SMTP , IMAP, does not support every Email, right? some it company does not support it?

              1 Reply Last reply
              0
              • R raven-worx
                24 Apr 2019, 17:14

                @opengpu
                not directly, only with 3rd party libs:
                https://github.com/cutelyst/simple-mail
                https://github.com/bluetiger9/SmtpClient-for-Qt
                ...
                and a SMTP server of course.

                or via IMAP server
                http://trojita.flaska.net/

                O Offline
                O Offline
                opengpu
                wrote on 25 Apr 2019, 04:05 last edited by
                #7

                @raven-worx said in is there anyway to Send Email to someone in Qt?:

                a SMTP server

                a SMTP server, or via IMAP server ??
                how to write it ? and can i run the server and client at the same PC?
                thanks

                J J 2 Replies Last reply 25 Apr 2019, 04:47
                0
                • O opengpu
                  25 Apr 2019, 04:05

                  @raven-worx said in is there anyway to Send Email to someone in Qt?:

                  a SMTP server

                  a SMTP server, or via IMAP server ??
                  how to write it ? and can i run the server and client at the same PC?
                  thanks

                  J Offline
                  J Offline
                  J.Hilk
                  Moderators
                  wrote on 25 Apr 2019, 04:47 last edited by
                  #8

                  @opengpu
                  the idea is, for example for SmtpClient-for-Qt, the following.

                  You have a gmail account, either provided by yourself or the user inputs his, and you use the client to connect, via socket connection, to gmail.
                  Then you use the connection to send the raw E-Mail informations ( receiver, topic content, attachments etc) via socket to gmail and they distribute it from there.


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  1 Reply Last reply
                  7
                  • O opengpu
                    25 Apr 2019, 04:05

                    @raven-worx said in is there anyway to Send Email to someone in Qt?:

                    a SMTP server

                    a SMTP server, or via IMAP server ??
                    how to write it ? and can i run the server and client at the same PC?
                    thanks

                    J Offline
                    J Offline
                    JonB
                    wrote on 25 Apr 2019, 07:28 last edited by
                    #9

                    @opengpu
                    You have asked about sending email from Qt. And been advised to look at a couple of simple SMTP clients for this. That will send emails to anyone/any server.

                    Why do you then start asking about SMTP/IMAP servers? Unless you have some special need for one, you should not be looking at servers at all.

                    O 1 Reply Last reply 25 Apr 2019, 08:45
                    3
                    • J JonB
                      25 Apr 2019, 07:28

                      @opengpu
                      You have asked about sending email from Qt. And been advised to look at a couple of simple SMTP clients for this. That will send emails to anyone/any server.

                      Why do you then start asking about SMTP/IMAP servers? Unless you have some special need for one, you should not be looking at servers at all.

                      O Offline
                      O Offline
                      opengpu
                      wrote on 25 Apr 2019, 08:45 last edited by
                      #10

                      @JonB thank you. got it. and all the company supply email service do have its server.

                      1 Reply Last reply
                      0
                      • R raven-worx
                        24 Apr 2019, 17:14

                        @opengpu
                        not directly, only with 3rd party libs:
                        https://github.com/cutelyst/simple-mail
                        https://github.com/bluetiger9/SmtpClient-for-Qt
                        ...
                        and a SMTP server of course.

                        or via IMAP server
                        http://trojita.flaska.net/

                        O Offline
                        O Offline
                        opengpu
                        wrote on 25 Apr 2019, 08:58 last edited by
                        #11

                        @raven-worx said in is there anyway to Send Email to someone in Qt?:

                        https://github.com/cutelyst/simple-mail
                        https://github.com/bluetiger9/SmtpClient-for-Qt

                        which one is better ?

                        1 Reply Last reply
                        0
                        • O Offline
                          O Offline
                          opengpu
                          wrote on 25 Apr 2019, 08:58 last edited by
                          #12

                          and is there any one for POP3 ?

                          J 1 Reply Last reply 25 Apr 2019, 09:01
                          0
                          • O opengpu
                            25 Apr 2019, 08:58

                            and is there any one for POP3 ?

                            J Offline
                            J Offline
                            JonB
                            wrote on 25 Apr 2019, 09:01 last edited by
                            #13

                            @opengpu
                            Any what for POP3? Read email client? Did you try Googling for Qt POP3 client (for which there are plenty of hits), or do you expect us to do the Googling and let you know?

                            O 1 Reply Last reply 25 Apr 2019, 09:07
                            2
                            • J JonB
                              25 Apr 2019, 09:01

                              @opengpu
                              Any what for POP3? Read email client? Did you try Googling for Qt POP3 client (for which there are plenty of hits), or do you expect us to do the Googling and let you know?

                              O Offline
                              O Offline
                              opengpu
                              wrote on 25 Apr 2019, 09:07 last edited by
                              #14

                              @JonB no, i want to send email at my Qt app

                              J 1 Reply Last reply 25 Apr 2019, 09:10
                              0
                              • O Offline
                                O Offline
                                opengpu
                                wrote on 25 Apr 2019, 09:08 last edited by
                                #15

                                i saw there is the setting at some email site; there are:
                                POP3 server
                                SMTP server
                                IMAP server

                                J 1 Reply Last reply 25 Apr 2019, 09:20
                                0
                                • O opengpu
                                  25 Apr 2019, 09:07

                                  @JonB no, i want to send email at my Qt app

                                  J Offline
                                  J Offline
                                  J.Hilk
                                  Moderators
                                  wrote on 25 Apr 2019, 09:10 last edited by
                                  #16

                                  @opengpu said in is there anyway to Send Email to someone in Qt?:

                                  I want to send email at my Qt app

                                  same difference, the previously mentioned clients should also be able to request from the sever, if new e-mails are available and forward it to your code.


                                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                  Q: What's that?
                                  A: It's blue light.
                                  Q: What does it do?
                                  A: It turns blue.

                                  1 Reply Last reply
                                  0
                                  • VRoninV Offline
                                    VRoninV Offline
                                    VRonin
                                    wrote on 25 Apr 2019, 09:19 last edited by
                                    #17

                                    POP3 is to receive emails and is obsolete.
                                    IMAP is to receive emails.
                                    SMTP is to send emails.

                                    Most servers both private corporate or services (like gmail) provide SMTP.
                                    If that protocol is unavailable the most common reason is that your company is using a very restrictive instance of Microsoft Exchange. In that case you can use EWS with C++/CLI or manually by sending SOAP messages.

                                    The main takeaway here is: find out if the email server allows for SMTP and if it does use that

                                    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                                    ~Napoleon Bonaparte

                                    On a crusade to banish setIndexWidget() from the holy land of Qt

                                    1 Reply Last reply
                                    5
                                    • O opengpu
                                      25 Apr 2019, 09:08

                                      i saw there is the setting at some email site; there are:
                                      POP3 server
                                      SMTP server
                                      IMAP server

                                      J Offline
                                      J Offline
                                      JonB
                                      wrote on 25 Apr 2019, 09:20 last edited by JonB
                                      #18

                                      @opengpu
                                      You seem to be making things pretty complicated for yourself, possibly because you have not read up on SMTP/POP3/IMAP.

                                      Your question is about sending emails, from your Qt app. For that all you need is SMTP client code in your app, and knowledge of which SMTP server you wish it to connect to send the email, e.g smtp.gmail.com if you have a Gmail account.

                                      POP3/IMAP are for retrieving emails from a server. You have never asked for that. Unless you now need that facility too, forget about them. You need SMTP client only.

                                      1 Reply Last reply
                                      5
                                      • O Offline
                                        O Offline
                                        opengpu
                                        wrote on 25 Apr 2019, 09:28 last edited by
                                        #19

                                        thanks for all. i google that protocol, and now i got it.

                                        J 1 Reply Last reply 25 Apr 2019, 09:37
                                        0
                                        • O opengpu
                                          25 Apr 2019, 09:28

                                          thanks for all. i google that protocol, and now i got it.

                                          J Offline
                                          J Offline
                                          JonB
                                          wrote on 25 Apr 2019, 09:37 last edited by JonB
                                          #20

                                          @opengpu
                                          BTW, I don't know if this will help you, but....

                                          In my case the users of my software specify & use there own SMTP server to connect to for sending email. Here is what my interafce looks like for them to specify the necessaries:

                                          0_1556184717892_smtpclient.png

                                          I don't know whether in your case you want the user to supply this information for their own SMTP email server, or whether you are supplying the server and hard-coding the values. Either way it shows the sort of parameters you will need to have in order to connect to the SMTP server.

                                          I program in Python/PyQt, not C++. So the SMTP client code I use is provided by a Python library, which won't be of any use to you. But either of the simple SMTP clients you are proposing to use will have a similar interface/parameters.

                                          O 1 Reply Last reply 25 Apr 2019, 10:17
                                          2

                                          4/48

                                          24 Apr 2019, 17:49

                                          44 unread
                                          • Login

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