Launching the default mail application - Programmer

This is a discussion on Launching the default mail application - Programmer ; If my application wants to have a menu item something like "Send by e-mail...", I'd like to launch the default mail application, have it enter Compose New Message mode, and have a file or set of files of my choosing ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Launching the default mail application

  1. Launching the default mail application

    If my application wants to have a menu item something like "Send by
    e-mail...", I'd like to launch the default mail application, have it
    enter Compose New Message mode, and have a file or set of files of my
    choosing be attachments to the outgoing message, how can I do that
    programmatically? The user (in the mail application) would then just
    need to specify the recipient(s) and a text message.

    - Paul

  2. Re: Launching the default mail application

    On Apr 8, 12:12 pm, pauljlucas.removet...@removethistoo.mac.com (Paul
    J. Lucas) wrote:
    > If my application wants to have a menu item something like "Send by
    > e-mail...", I'd like to launch the default mail application, have it
    > enter Compose New Message mode, and have a file or set of files of my
    > choosing be attachments to the outgoing message, how can I do that
    > programmatically? The user (in the mail application) would then just
    > need to specify the recipient(s) and a text message.
    >
    > - Paul




    Hi,

    Well, if you want to send eMail programmatically then you need to
    do some reading on "Messaging Application Programming Interface",
    also knowing as MAPI, the following functions can be used to send
    eMail in concert with a MAPI enabled mail client on your machine:

    MAPILogon()
    MAPISendMail()
    MAPISendDocuments()
    MAPIReadMail()
    MAPIDeleteMail()
    MAPISaveMail()
    MAPILogoff()

    Additionally, you can send eMail by using the SMTP protocol, the
    exact name for this technology is "Simple Mail Transfer Protocol",
    the SMTP server enables you to send eMail directly from your machine
    without using your internet service provider's server machine.

    http://msdn.microsoft.com/library/de...d07a51ca62.asp

    http://msdn.microsoft.com/library/de...3f63e84ecd.asp

    http://msdn.microsoft.com/library/de...90aa75d8c8.asp

    http://msdn.microsoft.com/library/de...ee5dddefd0.asp

    http://msdn.microsoft.com/library/de...264cf76bc3.asp

    http://msdn.microsoft.com/library/de...c7265181df.asp

    http://msdn.microsoft.com/library/de...65d8dc94ed.asp

    http://msdn.microsoft.com/library/de...81dc445604.asp

    http://www.smtp.com/

    Kellie.



  3. Re: Launching the default mail application

    In microsoft.public.win32.programmer Kellie Fitton wrote:
    > On Apr 8, 12:12 pm, pauljlucas.removet...@removethistoo.mac.com (Paul
    > J. Lucas) wrote:
    > > If my application wants to have a menu item something like "Send by
    > > e-mail...", I'd like to launch the default mail application, have it
    > > enter Compose New Message mode, and have a file or set of files of my
    > > choosing be attachments to the outgoing message, how can I do that
    > > programmatically? The user (in the mail application) would then just
    > > need to specify the recipient(s) and a text message.


    > Well, if you want to send eMail programmatically ...


    No, I don't. As I stated, I want to launch the default mail application
    programmatically, have *it* enter compose mode, attach the files I send it,
    and *stay* in compose mode. I couldn't care less whether the user
    *actually* clicks "Send."

    - Paul

  4. Re: Launching the default mail application

    On Thu, 12 Apr 2007 02:52:57 GMT,
    pauljlucas.removethis@removethistoo.mac.com (Paul J. Lucas) wrote:

    >In microsoft.public.win32.programmer Kellie Fitton wrote:
    >> On Apr 8, 12:12 pm, pauljlucas.removet...@removethistoo.mac.com (Paul
    >> J. Lucas) wrote:
    >> > If my application wants to have a menu item something like "Send by
    >> > e-mail...", I'd like to launch the default mail application, have it
    >> > enter Compose New Message mode, and have a file or set of files of my
    >> > choosing be attachments to the outgoing message, how can I do that
    >> > programmatically? The user (in the mail application) would then just
    >> > need to specify the recipient(s) and a text message.

    >
    >> Well, if you want to send eMail programmatically ...

    >
    >No, I don't. As I stated, I want to launch the default mail application
    >programmatically, have *it* enter compose mode, attach the files I send it,
    >and *stay* in compose mode. I couldn't care less whether the user
    >*actually* clicks "Send."


    In that case, try using the ShellExecute function to "run" an
    "address" (e.g. "mailto:support@penfact.com"). That will start
    whatever mail app the user has specified. I'm sure it's all done with
    some basic grunt work, but it sure seems like magic.


    >
    >- Paul


    -----------------------------------------
    To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

    Robert E. Zaret, eMVP
    PenFact, Inc.
    20 Park Plaza, Suite 478
    Boston, MA 02116
    www.penfact.com

  5. Re: Launching the default mail application

    In microsoft.public.win32.programmer r_z_aret@pen_fact.com wrote:
    > On Thu, 12 Apr 2007 02:52:57 GMT,
    > pauljlucas.removethis@removethistoo.mac.com (Paul J. Lucas) wrote:
    >
    > >No, I don't. As I stated, I want to launch the default mail application
    > >programmatically, have *it* enter compose mode, attach the files I send it,
    > >and *stay* in compose mode. I couldn't care less whether the user
    > >*actually* clicks "Send."

    >
    > In that case, try using the ShellExecute function to "run" an
    > "address" (e.g. "mailto:support@penfact.com"). That will start
    > whatever mail app the user has specified. I'm sure it's all done with
    > some basic grunt work, but it sure seems like magic.


    That doesn't solve my whole problem. I also want to have the mail client
    attach files I give it.

    - Paul

  6. Re: Launching the default mail application

    "Paul J. Lucas" wrote in message
    news:IiRTh.14684$JZ3.6792@newssvr13.news.prodigy.n et...
    > In microsoft.public.win32.programmer r_z_aret@pen_fact.com wrote:
    > > On Thu, 12 Apr 2007 02:52:57 GMT,
    > > pauljlucas.removethis@removethistoo.mac.com (Paul J. Lucas) wrote:
    > >
    > > >No, I don't. As I stated, I want to launch the default mail application
    > > >programmatically, have *it* enter compose mode, attach the files I send it,
    > > >and *stay* in compose mode. I couldn't care less whether the user
    > > >*actually* clicks "Send."

    > >
    > > In that case, try using the ShellExecute function to "run" an
    > > "address" (e.g. "mailto:support@penfact.com"). That will start
    > > whatever mail app the user has specified. I'm sure it's all done with
    > > some basic grunt work, but it sure seems like magic.

    >
    > That doesn't solve my whole problem. I also want to have the mail client
    > attach files I give it.


    Some googling for my mail client resulted in this command:
    Outlook /a "C:\My Documents\labels.doc" (as seen on
    http://www.outlook-tips.net/howto/commandlines.htm ).
    While this should work just fine with ShellExecute, I suspect only so for (this
    version of!) Outlook.
    The SendTo menu features a destination "Mail Recipient", and the shortcut in the
    SendTo system dir is of type "MAPIMAIL File" (size: 0 bytes.... -- in my
    registry it resolves to something called "sendmail.dll"). Apparently, attaching
    files _is_ a MAPI operation after all.

    [Jongware]



  7. Re: Launching the default mail application

    "Paul J. Lucas" wrote in
    message news:dahTh.2760$zC.223@newssvr22.news.prodigy.net. ..
    > In microsoft.public.win32.programmer Kellie Fitton
    > wrote:
    >> On Apr 8, 12:12 pm, pauljlucas.removet...@removethistoo.mac.com (Paul
    >> J. Lucas) wrote:
    >> > If my application wants to have a menu item something like "Send by
    >> > e-mail...", I'd like to launch the default mail application, have it
    >> > enter Compose New Message mode, and have a file or set of files of my
    >> > choosing be attachments to the outgoing message, how can I do that
    >> > programmatically? The user (in the mail application) would then just
    >> > need to specify the recipient(s) and a text message.

    >
    >> Well, if you want to send eMail programmatically ...

    >
    > No, I don't. As I stated, I want to launch the default mail application
    > programmatically, have *it* enter compose mode, attach the files I send
    > it,
    > and *stay* in compose mode. I couldn't care less whether the user
    > *actually* clicks "Send."
    >
    > - Paul


    A common quote is that it is possible to lead a Horse to water but not
    possible to make them drink it. I think you were provided a solution but
    chose to assume it is not useful. I am familiar with MAPI and as best as I
    remember it will do what you asked for. The only problem I think is
    terminology.

    I know this is an old message. There is a higher-level (simpler) interface
    called CDO that also might work, but I won't look for details unless it
    still is a possibility.

    Had this question been asked in the appropriate newsgroup it would have
    gotten much better answers.



+ Reply to Thread