Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. How can the user send email to me from my app ?

How can the user send email to me from my app ?

Scheduled Pinned Locked Moved Unsolved Brainstorm
qt5.7.0
32 Posts 8 Posters 15.0k 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.
  • A Offline
    A Offline
    Ahti
    wrote on 2 Oct 2016, 07:28 last edited by Ahti 10 Feb 2016, 07:29
    #1

    I have a contact tab in my app in which i want to let user type his/her email, subject and body and whenever they click on submit button the mail should be send to my email address. How can i do that ?

    what is a signature ?? Lol

    O 1 Reply Last reply 17 Oct 2016, 11:47
    0
    • P Offline
      P Offline
      p3c0
      Moderators
      wrote on 2 Oct 2016, 07:50 last edited by
      #2

      @Ahti
      Search for SMTP library for Qt

      157

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 2 Oct 2016, 08:58 last edited by mrjj 10 Feb 2016, 08:59
        #3

        Like this one
        https://github.com/xcoder123/SimpleSmtp_SSL_QT5

        A 1 Reply Last reply 2 Oct 2016, 09:53
        3
        • M mrjj
          2 Oct 2016, 08:58

          Like this one
          https://github.com/xcoder123/SimpleSmtp_SSL_QT5

          A Offline
          A Offline
          Ahti
          wrote on 2 Oct 2016, 09:53 last edited by
          #4

          @mrjj

          I actually want to create a forum which has To, From, Subject and body in it and i want user to just type his/her email in the 'From' section and whenever he/she clicks on submit button the mail should get forwarded to me. I don't want him/her to login by giving their email and password i just want them to send me the mail by just mentioning their email address. Is that possible ?

          what is a signature ?? Lol

          M 1 Reply Last reply 2 Oct 2016, 10:14
          0
          • A Ahti
            2 Oct 2016, 09:53

            @mrjj

            I actually want to create a forum which has To, From, Subject and body in it and i want user to just type his/her email in the 'From' section and whenever he/she clicks on submit button the mail should get forwarded to me. I don't want him/her to login by giving their email and password i just want them to send me the mail by just mentioning their email address. Is that possible ?

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 2 Oct 2016, 10:14 last edited by
            #5

            @Ahti
            Well you own app can allow sending email, however you like.
            BUT the server you are using for sending the emails demands login.
            So your app must login it self for it to send any emails.
            Due to spam, there are very few mail servers that allows sending email
            anonymously these days.

            A 1 Reply Last reply 2 Oct 2016, 11:05
            2
            • M mrjj
              2 Oct 2016, 10:14

              @Ahti
              Well you own app can allow sending email, however you like.
              BUT the server you are using for sending the emails demands login.
              So your app must login it self for it to send any emails.
              Due to spam, there are very few mail servers that allows sending email
              anonymously these days.

              A Offline
              A Offline
              Ahti
              wrote on 2 Oct 2016, 11:05 last edited by
              #6

              @mrjj

              what do you mean by my app should login first ? does that mean i should first login my email account ?

              what is a signature ?? Lol

              M 1 Reply Last reply 2 Oct 2016, 14:55
              0
              • A Ahti
                2 Oct 2016, 11:05

                @mrjj

                what do you mean by my app should login first ? does that mean i should first login my email account ?

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 2 Oct 2016, 14:55 last edited by
                #7

                @Ahti
                To be allowed to send emails via google server you need to be
                authenticated. So yes, your app must "log in" to the google account you
                are sending over.

                A 1 Reply Last reply 2 Oct 2016, 14:59
                2
                • M mrjj
                  2 Oct 2016, 14:55

                  @Ahti
                  To be allowed to send emails via google server you need to be
                  authenticated. So yes, your app must "log in" to the google account you
                  are sending over.

                  A Offline
                  A Offline
                  Ahti
                  wrote on 2 Oct 2016, 14:59 last edited by Ahti 10 Feb 2016, 15:22
                  #8

                  @mrjj

                  I don't understand this why i have to login my account ? the user who is using my app sends the email to my email address now if i login my account to the users machine there is no point of it.

                  what is a signature ?? Lol

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    p3c0
                    Moderators
                    wrote on 2 Oct 2016, 17:22 last edited by
                    #9

                    @Ahti @mrjj probably meant to say that you will need an email service so that users can send an email. And this email service will provide an email gateway. To use this gateway you will need an authentication.

                    157

                    A 1 Reply Last reply 3 Oct 2016, 09:57
                    4
                    • P p3c0
                      2 Oct 2016, 17:22

                      @Ahti @mrjj probably meant to say that you will need an email service so that users can send an email. And this email service will provide an email gateway. To use this gateway you will need an authentication.

                      A Offline
                      A Offline
                      Ahti
                      wrote on 3 Oct 2016, 09:57 last edited by
                      #10

                      @p3c0

                      and how can i aquire all this ?

                      what is a signature ?? Lol

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        p3c0
                        Moderators
                        wrote on 3 Oct 2016, 10:06 last edited by
                        #11

                        Have you registered to any email service ?

                        157

                        A 1 Reply Last reply 3 Oct 2016, 15:22
                        1
                        • P p3c0
                          3 Oct 2016, 10:06

                          Have you registered to any email service ?

                          A Offline
                          A Offline
                          Ahti
                          wrote on 3 Oct 2016, 15:22 last edited by
                          #12

                          @p3c0

                          I have an account in gmail and yahoo

                          what is a signature ?? Lol

                          1 Reply Last reply
                          0
                          • V Offline
                            V Offline
                            VRonin
                            wrote on 3 Oct 2016, 15:40 last edited by
                            #13

                            When there is a library that is considered standard I tend to suggest it over some 1-man-wrapper. Not because the latter is bad but it's so much easier to find docs/examples/support when a library is very popular.

                            This leads me to libcurl (there are some relatively active C++ bindings like https://github.com/JosephP91/curlcpp but the core C api should be more than enough for what you are trying to do)

                            Here you can find an example of sending an email using gmail

                            "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

                            A 2 Replies Last reply 3 Oct 2016, 15:56
                            2
                            • V VRonin
                              3 Oct 2016, 15:40

                              When there is a library that is considered standard I tend to suggest it over some 1-man-wrapper. Not because the latter is bad but it's so much easier to find docs/examples/support when a library is very popular.

                              This leads me to libcurl (there are some relatively active C++ bindings like https://github.com/JosephP91/curlcpp but the core C api should be more than enough for what you are trying to do)

                              Here you can find an example of sending an email using gmail

                              A Offline
                              A Offline
                              Ahti
                              wrote on 3 Oct 2016, 15:56 last edited by
                              #14

                              @VRonin

                              Well that is difficult to understand and i don't know how to implement it.

                              what is a signature ?? Lol

                              J 1 Reply Last reply 4 Oct 2016, 04:52
                              0
                              • V VRonin
                                3 Oct 2016, 15:40

                                When there is a library that is considered standard I tend to suggest it over some 1-man-wrapper. Not because the latter is bad but it's so much easier to find docs/examples/support when a library is very popular.

                                This leads me to libcurl (there are some relatively active C++ bindings like https://github.com/JosephP91/curlcpp but the core C api should be more than enough for what you are trying to do)

                                Here you can find an example of sending an email using gmail

                                A Offline
                                A Offline
                                Ahti
                                wrote on 3 Oct 2016, 16:01 last edited by Ahti 10 Mar 2016, 16:02
                                #15

                                @VRonin @p3c0 @mrjj

                                Okay guys tell me how can i simply let user to login to his/her email from my app and then let them send email to me ?? I have to get connected to the email server before i let them sign in right ?

                                what is a signature ?? Lol

                                V 1 Reply Last reply 3 Oct 2016, 16:44
                                0
                                • P Offline
                                  P Offline
                                  p3c0
                                  Moderators
                                  wrote on 3 Oct 2016, 16:29 last edited by
                                  #16

                                  @Ahti Your users will use their email address only to login to you forum.
                                  Now that you have email service and a registered user to use that service, your users will use this email user to send email to you.
                                  You should probably maintain multiple users in case if you have a large userbase.

                                  157

                                  1 Reply Last reply
                                  0
                                  • A Ahti
                                    3 Oct 2016, 16:01

                                    @VRonin @p3c0 @mrjj

                                    Okay guys tell me how can i simply let user to login to his/her email from my app and then let them send email to me ?? I have to get connected to the email server before i let them sign in right ?

                                    V Offline
                                    V Offline
                                    VRonin
                                    wrote on 3 Oct 2016, 16:44 last edited by
                                    #17

                                    @Ahti said in How can the user send email to me from my app ?:

                                    Okay guys tell me how can i simply let user to login to his/her email from my app and then let them send email to me ?

                                    This is even harder as you should know their mail server and sometimes you cannot really access it (for example if they use a private MS exchange server)

                                    I put here another example with libcurl: https://curl.haxx.se/libcurl/c/smtp-mail.html

                                    If you think it's not for you then the easy route is using QDesktopServices::openUrl("mailto:youremail@address.com");

                                    "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
                                    7
                                    • A Ahti
                                      3 Oct 2016, 15:56

                                      @VRonin

                                      Well that is difficult to understand and i don't know how to implement it.

                                      J Offline
                                      J Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on 4 Oct 2016, 04:52 last edited by
                                      #18

                                      @Ahti Why not just let the user use their preferred EMail client to send an EMail to you? See http://stackoverflow.com/questions/28674805/open-default-mail-app-from-within-qt-with-some-html
                                      It is much easier and the user can use his/her EMail client.
                                      You still can have a form in your app (I guess you meant form not forum?), but then you pass that data via a mailto: URL to the system, which then opens the standard EMail client and fill the data user entered in your form.

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      A 1 Reply Last reply 4 Oct 2016, 07:39
                                      1
                                      • J jsulm
                                        4 Oct 2016, 04:52

                                        @Ahti Why not just let the user use their preferred EMail client to send an EMail to you? See http://stackoverflow.com/questions/28674805/open-default-mail-app-from-within-qt-with-some-html
                                        It is much easier and the user can use his/her EMail client.
                                        You still can have a form in your app (I guess you meant form not forum?), but then you pass that data via a mailto: URL to the system, which then opens the standard EMail client and fill the data user entered in your form.

                                        A Offline
                                        A Offline
                                        Ahti
                                        wrote on 4 Oct 2016, 07:39 last edited by
                                        #19

                                        @jsulm
                                        Okay why would he has to login from the broswer and then use my app to send email to me ? Can't he simply login to his email account from my app and send mail to me from my app ? And yes i meant form not forum sorry for the mistake. And i used that "QDesktopService..." And it opens up MS outlook.

                                        what is a signature ?? Lol

                                        J 1 Reply Last reply 4 Oct 2016, 07:58
                                        0
                                        • M Offline
                                          M Offline
                                          mrjj
                                          Lifetime Qt Champion
                                          wrote on 4 Oct 2016, 07:47 last edited by mrjj 10 Jun 2016, 06:16
                                          #20

                                          Ok. listen. we need to talk about sending emails.

                                          A program cannot just send email. It need the help of
                                          a mail server. That is another PC that has a post office program.
                                          Like GMAIL is. its a mail service.

                                          So for your program to send mails, you need to send via such server.

                                          That can happen

                                          1: You pop outlook via QDesktopService and the mail is sent over whatever server outlook is using.

                                          2: You send via a google account that your program knows username and password for.
                                          So before sending email via GOOGLE you will login to this account inside the program.
                                          This is part of the SMTP protocol.

                                          3: You use some online mail service where you can send email via some API.

                                          You could also ask user to login to his mail service but I would never give my password to any unknown program so it's not a good solution and also teaches the users to do stupid things.

                                          So the part you need to understand is that Sending email demands that the MAIL server knows who u are. So the programs need to supply username and password to the MAil server
                                          to be allowed to send anything.

                                          A 2 Replies Last reply 5 Oct 2016, 14:14
                                          4

                                          5/32

                                          2 Oct 2016, 10:14

                                          27 unread
                                          • Login

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