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. Other Discussions
  3. Article Writing
  4. Calling a user's email client on windows

Calling a user's email client on windows

Scheduled Pinned Locked Moved Article Writing
comtutorialquestionlearning
8 Posts 5 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.
  • R Offline
    R Offline
    Russell Robinson
    wrote on last edited by
    #1

    I want my application to interface to the user's email client application. I've currently got this working using MAPI, but, of course, not all email clients use MAPI. On my computer it calls MS Outlook, but my real email application is Netscape. I've tried PJ Naughters' SMTP class but you have to know what the user's SMTP service is called (e.g. smtp.ozemail.com.au, or whatever) and this actually bypasses their email application. I've also tried his CMC class, but CMC seems to be an ancient concept that has not continued existence. My requirement is simply to call the user's email application, supplying the "to" address and an attachment. Does anyone have any idea how to do this on Windows? (It's trivial on UNIX). Russell Robinson (russellr@rootsoftware.com) Author of TTMaker (Advanced Timetabling Software) http://www.rootsoftware.com

    M 1 Reply Last reply
    0
    • R Russell Robinson

      I want my application to interface to the user's email client application. I've currently got this working using MAPI, but, of course, not all email clients use MAPI. On my computer it calls MS Outlook, but my real email application is Netscape. I've tried PJ Naughters' SMTP class but you have to know what the user's SMTP service is called (e.g. smtp.ozemail.com.au, or whatever) and this actually bypasses their email application. I've also tried his CMC class, but CMC seems to be an ancient concept that has not continued existence. My requirement is simply to call the user's email application, supplying the "to" address and an attachment. Does anyone have any idea how to do this on Windows? (It's trivial on UNIX). Russell Robinson (russellr@rootsoftware.com) Author of TTMaker (Advanced Timetabling Software) http://www.rootsoftware.com

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      To get you started, you can call ShellExecute() on "mailto:person@whatever.com?Subject=Subject here" to open the mail client with a new message. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.

      R 1 Reply Last reply
      0
      • M Michael Dunn

        To get you started, you can call ShellExecute() on "mailto:person@whatever.com?Subject=Subject here" to open the mail client with a new message. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.

        R Offline
        R Offline
        Russell Robinson
        wrote on last edited by
        #3

        Thanks for the suggestion Mike, but there's no way to attach a file with this "mailto" mechanism. Russell Robinson (russellr@rootsoftware.com) Author of TTMaker (Advanced Timetabling Software) http://www.rootsoftware.com

        A 1 Reply Last reply
        0
        • R Russell Robinson

          Thanks for the suggestion Mike, but there's no way to attach a file with this "mailto" mechanism. Russell Robinson (russellr@rootsoftware.com) Author of TTMaker (Advanced Timetabling Software) http://www.rootsoftware.com

          A Offline
          A Offline
          Andrew Peace
          wrote on last edited by
          #4

          Yep, sure is. Just use mailto:address@domain.com?attach="your attachment.ext" Hope that helps, Andrew.

          S R 3 Replies Last reply
          0
          • A Andrew Peace

            Yep, sure is. Just use mailto:address@domain.com?attach="your attachment.ext" Hope that helps, Andrew.

            S Offline
            S Offline
            Simon Brown
            wrote on last edited by
            #5

            Is there any way of specifying the attachment *and* a subject? Thanks for this excellent tip.

            O 1 Reply Last reply
            0
            • S Simon Brown

              Is there any way of specifying the attachment *and* a subject? Thanks for this excellent tip.

              O Offline
              O Offline
              orcun colak
              wrote on last edited by
              #6

              I tried this using outlook and it worked for setting both subject and attachment. CString strTemp = _T("C:\\test.txt"); strTemp.Format (_T("mailto:xxx@yyy.com?Subject=My subject\"%s\""),strFilePath); ShellExecute (NULL, //Parent window _T("open"), //verb strTemp, NULL,//File NULL,//Parameters SW_SHOW);

              1 Reply Last reply
              0
              • A Andrew Peace

                Yep, sure is. Just use mailto:address@domain.com?attach="your attachment.ext" Hope that helps, Andrew.

                S Offline
                S Offline
                Simon Brown
                wrote on last edited by
                #7

                Hi Andrew, With Outlook Express 5 I can't get ?attach to do anything - it seems to be ignored. ?subject works fine though. Do you (or anyone) have any suggestion? I remember trying this a couple of years ago and getting nowhere. It is much better than using MAPI, but I have to be able to specify the attachment. Cheers, Simon :confused:

                1 Reply Last reply
                0
                • A Andrew Peace

                  Yep, sure is. Just use mailto:address@domain.com?attach="your attachment.ext" Hope that helps, Andrew.

                  R Offline
                  R Offline
                  Russell Robinson
                  wrote on last edited by
                  #8

                  Hi Andrew, Thanks for the response, and I'm sorry that I haven't replied sooner.....been busy fighting other fires. Unfortunately, the attach parameter doesn't seem to work at all. I've tried with Outlook Express 5 and Netscape Communicator as email clients. It doesn't work with either. I can get subject and body parameters to work, but the attach is just ignored. Also, I haven't found any information anywhere on the net that documents this facility. RFCs 1738 and 2368 don't mention "attach", though RFC 2368 allows for the possibility of it. So, it looks like I'm going to have to "do it myself" somehow. (We are in the 21st century aren't we??????) Russell Robinson (russellr@rootsoftware.com) Author of TTMaker (Advanced Timetabling Software) http://www.rootsoftware.com

                  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