Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Initiate Sending EMail from C++

Initiate Sending EMail from C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++
7 Posts 4 Posters 0 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.
  • V Offline
    V Offline
    Vancouver
    wrote on last edited by
    #1

    I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).

    N PJ ArendsP S 3 Replies Last reply
    0
    • V Vancouver

      I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).

      N Offline
      N Offline
      Neville Franks
      wrote on last edited by
      #2

      Have a look at Articles on MAPI. You can't guarantee that a MAPI client is available however. Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

      V 1 Reply Last reply
      0
      • V Vancouver

        I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        The simpliest way is to use the ShellExecute() function, specifying the email address in the lpFile parameter

        ShellExecute (NULL, "open", "mailto:who@where.ever", NULL, NULL, SW_SHOW);

        You can also specify the subject, cc, and bcc in the lpFile parameter

        ShellExecute(NULL, "open", "mailto:who@where.ever&cc=you@them.org&bcc=them@you.org&subject=hello", NULL, NULL, SW_SHOW);

        If you want to add text or attachments then have a look at SIMPLE MAPI


        "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!

        Within you lies the power for good; Use it!

        V 1 Reply Last reply
        0
        • V Vancouver

          I found various articles about creating and sending emails and about sending attachments. However I need something simpler: I have an email address and want the resident mail system to create an email with the normal user interaction, i.e. my contribution is only waking the mail service and supplying the address. It has to be in C++, dialog-oriented (non-SDI, non-MDI).

          S Offline
          S Offline
          Shog9 0
          wrote on last edited by
          #4

          I'm quite partial to this. A good place to start, at least.
          You left me high and dry and changed me You lied to me and now i’m angry**...**

          V 1 Reply Last reply
          0
          • PJ ArendsP PJ Arends

            The simpliest way is to use the ShellExecute() function, specifying the email address in the lpFile parameter

            ShellExecute (NULL, "open", "mailto:who@where.ever", NULL, NULL, SW_SHOW);

            You can also specify the subject, cc, and bcc in the lpFile parameter

            ShellExecute(NULL, "open", "mailto:who@where.ever&cc=you@them.org&bcc=them@you.org&subject=hello", NULL, NULL, SW_SHOW);

            If you want to add text or attachments then have a look at SIMPLE MAPI


            "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!

            V Offline
            V Offline
            Vancouver
            wrote on last edited by
            #5

            Thank you; this is obviously the simplest solution. Exactly, what I needed in this situation. One remark: the show comman flag (SW_SHOW, or whatever else) has no effect in this case. The documentation states, that it is only for the case, then an executable file is specified. I tested it with "mailto", and it makes no difference.

            1 Reply Last reply
            0
            • N Neville Franks

              Have a look at Articles on MAPI. You can't guarantee that a MAPI client is available however. Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"

              V Offline
              V Offline
              Vancouver
              wrote on last edited by
              #6

              Thanks, but my program does not have the message content to send. In fact, I have only an email address in my hand.

              1 Reply Last reply
              0
              • S Shog9 0

                I'm quite partial to this. A good place to start, at least.
                You left me high and dry and changed me You lied to me and now i’m angry**...**

                V Offline
                V Offline
                Vancouver
                wrote on last edited by
                #7

                It appears to be an elegant solution, but it shoots a magnitude farther than I can use in the given context. Thanks anyway.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups