如何用电子邮件地址打开Outlook [英] how to open outlook with email address

查看:155
本文介绍了如何用电子邮件地址打开Outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Buttom上点击我想打开一个包含特定地址的Outlook,



private void button1_Click_1(object sender,EventArgs e)

{

System.Diagnostics.Process.Start(" Outlook");



}

当我点击Button1时,它打开了Oulook的窗口,但现在我希望它加载到电子邮件地址:

说,TO。 Test@hotmail.com //这个地址在地址行中

解决方案

假设您正在编写Windows应用程序(Windows Forms,WPF等),那么你需要传递一个 mailto: URI [ ^ ]到 Process.Start 方法:

 System.Diagnostics.Process.Start(  mailto:test@hotmail.com); 



如果您正在编写ASP.NET应用程序,那么您需要使用 mailto: link 在用户的计算机上启动电子邮件客户端,而不是在服务器上启动:

 <   a    < span class =code-attribute> href   =  mailto:test@hotmail.com > 发​​送电子邮件<   / a  >  


< blockquote>在Button Click事件中使用以下代码

 System.Diagnostics.Process.Start(mailto:test@hotmail.com );  

on my Buttom click i want to open an Outlook with particular address in it,

private void button1_Click_1(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Outlook");

}
SO far when i click on Button1 it opens window for Oulook but now i want it to loaded to Email Address:
say,TO. Test@hotmail.com //this address in a Address line with it

解决方案

Assuming you're writing a Windows application (Windows Forms, WPF, etc.), then you need to pass a mailto: URI[^] to the Process.Start method:

System.Diagnostics.Process.Start("mailto:test@hotmail.com");


If you're writing an ASP.NET application, then you need to use a mailto: link to launch the email client on the user's computer, rather than on the server:

<a href="mailto:test@hotmail.com">Send an email</a>


use the following code in Button Click event

System.Diagnostics.Process.Start("mailto:test@hotmail.com");


这篇关于如何用电子邮件地址打开Outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆