简体   繁体   English

Process.Start无法在实时站点上工作

[英]Process.Start not working on live site

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? 有没有一种方法可以让我用javascript寻找内容?

You'll have to register the mailto Protocol handler for that to work off the box like that. 您必须注册mailto协议处理程序,才能像这样正常工作。

look at Register Windows program with the mailto protocol programmatically on how it can be accomplished thru code. 查看如何使用mailto协议以编程方式注册Windows程序,以了解如何通过代码完成该程序。

or 要么

If you want to open Outlook and send out a mail to someone - 如果您要打开Outlook并向某人发送邮件-

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();

The problem is probabbly is that your client doesn't have default Mail Client setupped on machine. 问题很可能是您的客户端没有在计算机上设置默认邮件客户端

Hope this helps. 希望这可以帮助。

在JavaScript中,只需设置location.href

<input type="button" value="Send E-mall" onclick="location.href='mailto:blah@blah.com';"> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM