Results 1 to 6 of 6

Thread: Launch default Email package

  1. #1

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Launch default Email package

    When I click Run on the Start menu and type in "mailto:[email protected]" on my PC it opens a new Email message in Outlook with that address pre-populated.

    1. If I did this on some other PC (with a different Email package) would it still launch the Email in the same way?

    2. How do I do this from my VB code?

    I'm just writing a simple desktop application and it seems to me that this is the simplest and most portable way of launching an Email when the user clicks on the support Email link on the Help/About form.
    This world is not my home. I'm just passing through.

  2. #2

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    Further to the above, if I use the following

    mailto:[email protected]?cc= &bcc= &subject=Howzit &body=

    then Outlook fills in the subject field and leaves the cursor in the main body.

    Can someone with a different Email package try the same command line and tell me what happens?

    Ta.
    This world is not my home. I'm just passing through.

  3. #3

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536

    Progress

    Ok.

    I've got this working on my PC

    VB Code:
    1. ' Declare and instantiate a new process component.
    2.         Dim myproc As System.Diagnostics.Process
    3.         myproc = New System.Diagnostics.Process()
    4.  
    5.         ' Do not receive an event when the process exits.
    6.         myproc.EnableRaisingEvents = False
    7.         ' Start the default Email package, passing in command line details.
    8.         myproc.Start("mailto:[email protected]?cc= &bcc= &subject=Howzit &body= ")
    I'd still like somebody with some other Email package (not Outlook) to try it out if they'd be so kind...
    This world is not my home. I'm just passing through.

  4. #4
    New Member
    Join Date
    Jul 2003
    Location
    Toledo, Ohio
    Posts
    5

    Re: Progress

    Originally posted by trisuglow
    Ok.

    I've got this working on my PC

    VB Code:
    1. ' Declare and instantiate a new process component.
    2.         Dim myproc As System.Diagnostics.Process
    3.         myproc = New System.Diagnostics.Process()
    4.  
    5.         ' Do not receive an event when the process exits.
    6.         myproc.EnableRaisingEvents = False
    7.         ' Start the default Email package, passing in command line details.
    8.         myproc.Start("mailto:[email protected]?cc= &bcc= &subject=Howzit &body= ")
    I'd still like somebody with some other Email package (not Outlook) to try it out if they'd be so kind...

    At work, we run Lotus Notes. When I try to run your code in .NET, it brings up Notes... but does not populate the fields or even begin a new message. Probably just a Notes thing, but I figured I'd mention it to you anyway.

  5. #5

    Thread Starter
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    Hi Tektrader,

    If you'd be so kind, would you mind trying this simplified code?

    I was hoping that Outlook's command line used some kind of standard (e.g. CGI) that would be compatible with most other mail programs. It looks like maybe Notes didn't like it...


    Just try mailto:[email protected] in Start\Run if you don't want to run up .NET again.

    Thanks if you have time to do this - I appreciate it.


    Tris.


    VB Code:
    1. ' Declare and instantiate a new process component.
    2.         Dim myproc As System.Diagnostics.Process
    3.         myproc = New System.Diagnostics.Process()
    4.  
    5.         ' Do not receive an event when the process exits.
    6.         myproc.EnableRaisingEvents = False
    7.         ' Start the default Email package, passing in command line details.
    8.         myproc.Start("mailto:[email protected]")
    This world is not my home. I'm just passing through.

  6. #6
    New Member
    Join Date
    Jul 2003
    Location
    Toledo, Ohio
    Posts
    5
    Originally posted by trisuglow
    Hi Tektrader,

    If you'd be so kind, would you mind trying this simplified code?

    I was hoping that Outlook's command line used some kind of standard (e.g. CGI) that would be compatible with most other mail programs. It looks like maybe Notes didn't like it...


    Just try mailto:[email protected] in Start\Run if you don't want to run up .NET again.

    Thanks if you have time to do this - I appreciate it.


    Tris.


    VB Code:
    1. ' Declare and instantiate a new process component.
    2.         Dim myproc As System.Diagnostics.Process
    3.         myproc = New System.Diagnostics.Process()
    4.  
    5.         ' Do not receive an event when the process exits.
    6.         myproc.EnableRaisingEvents = False
    7.         ' Start the default Email package, passing in command line details.
    8.         myproc.Start("mailto:[email protected]")
    I reran the new code you have, and same thing... it brings Notes to the foreground (or start Notes if it isn't already running), but it won't start a new message. I'm certain it's just because Notes is crap (did I mention that when it locks up and you crowbar it... you HAVE to reboot your machine in order to rerun Notes???). I wrote a program that fixes that (looks for and kills the leftover processes), but it's still a pain in the behind. I'll look for a generic command line for Notes that would allow it to do what you need, and you can just have your code look to see if Notes is the default mail program... then use the command line arguments/switch(es) if it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width