Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2004
    Posts
    194
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Launch Email Client & Send Email

    I'm using the JavaScript Shell.Execute command to run applications from my organisations intranet when a link is clicked on. Our default email client is Novell GroupWise. The idea is I would like to create something that has the same kind of effect as a mailto: hyperlink. So rather than GroupWise simply opening, it opens and brings up a send email window with the email address entered for you like how Outlook does when you click a mailto: link as naturally you cannot set your email client to GroupWise in IE. The code I have so far is:

    Code:
    <script type="text/javascript">
    
    var idShell = new ActiveXObject("Shell.Application");
    
    function LaunchGroupWise() {
    	idShell.ShellExecute("GrpWise.exe");
    
    }
    
    </script>
    
    <a href="javascript:void(0)" onClick="LaunchGroupWise();" title="Launch Novell GroupWise">GroupWise</a>
    What I was hoping is possible is that there is some type of send email parameter that could be added to automatically populate the To field of the email such as:

    Code:
    <script type="text/javascript">
    
    var idShell = new ActiveXObject("Shell.Application");
    
    function LaunchGroupWise() {
    	idShell.ShellExecute("GrpWise.exe", "", "mailto:some@one.com");
    
    }
    
    </script>
    
    <a href="javascript:void(0)" onClick="LaunchGroupWise();" title="Launch Novell GroupWise">GroupWise</a>
    Naturally the above doesn't work, but does anyone know of something which might make this possible?

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    For my intranet apps that use this sort of thing, I check the documentation for command-line (DOS) params I could use, then shell.execute that whole DOS command.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Location
    Toronto, ON, Canada
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I assume your Intranet is M$ based /new ActiveXObject(..)/

    Instead of running a shell ActiveX you should use the ActiveX SMTP client. Search Internet for one (or you can write one).

    the javascript code should look like as:

    Code:
    <script>
    function sendMsg() {
      var smtpClient = new ActiveXObject('mySmtpComponent');
      smtpClient.Server('smtp.company.com');
      smtpClient.To('aaa@company.com');
      smtpClient.Sender('myself@company.com');
      smtpClient.Subject('sunject Line');
      smtpClient.Text('blah blah blah');
      smtpClient.Send();
    }
    </script>
    Bad thing is every PC needs to have SMTP Client installed (dinamically download).

    The better solution is to send mail from application server insetad of browser, unless email is to be sent as warning when application server is down.
    rm -f /


  •  

    Posting Permissions

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