0

Im trying to open the email client after a user accepts a disclaimer in a popup box whenever they click email someone. It works on local but will not work on live.

public void btnEmail_click(object sender, EventArgs e)
{             
     Process.Start("mailto:blah@blah.com");
}

I realize now this will not work correctly obviously. Is there a way to do what im looking for with javascript?

Snake3ite
  • 43
  • 2
  • 7

3 Answers3

0

You'll have to register the mailto Protocol handler for that to work off the box like that.

look at Register Windows program with the mailto protocol programmatically on how it can be accomplished thru code.

or

If you want to open Outlook and send out a mail to someone -

Outlook /c ipm.note /m blah@blah.com

Thru Code -

string app = "Outlook.exe";
string arguments = @"/c ipm.note /m blah@blah.com";

Process proc = new Process();
proc.StartInfo = new ProcessStartInfo(app, arguments);
proc.Start();
Community
  • 1
  • 1
abhilash
  • 5,605
  • 3
  • 36
  • 59
0

The problem is probabbly is that your client doesn't have default Mail Client setupped on machine.

Hope this helps.

Tigran
  • 61,654
  • 8
  • 86
  • 123
  • No im testing on my machine and i do have Outlook defaulted – Snake3ite Apr 18 '12 at 13:10
  • @Snake3ite: so porbbably your default browser is not connected to mailclient. – Tigran Apr 18 '12 at 13:13
  • @Snake3ite: for example for IE8 [How to Configure Email in Internet Explorer 8 Read more: How to Configure Email in Internet Explorer 8 | eHow.com http://www.ehow.com/how_5879297_configure-email-internet-explorer-8.html#ixzz1sOhh8rac](http://www.ehow.com/how_5879297_configure-email-internet-explorer-8.html) – Tigran Apr 18 '12 at 13:14
  • No, the problem is that there's nobody logged in to the server to see the email window open. – scott.korin Apr 18 '12 at 14:57
  • @scott.korin: how did you figure out that? I don't see any notion of that in the comments. – Tigran Apr 18 '12 at 15:00
0

In JavaScript, just set the location.href

<input type="button" value="Send E-mall" onclick="location.href='mailto:blah@blah.com';"> 
scott.korin
  • 2,537
  • 2
  • 23
  • 36