C#Windows窗体Outlook邮件 [英] C# windows forms outlook mail

查看:119
本文介绍了C#Windows窗体Outlook邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们单击按钮时该怎么办?我想通过使用Windows窗体中的C#在Outlook中打开新的MailMessage窗口
请先谢谢.我找出了代码


私有void btnoutlookmail_Click(对象发送者,EventArgs e)
{


Microsoft.Office.Interop.Outlook.Application outlookApp =新的Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MailItem outlookmail =(Microsoft.Office.Interop.Outlook.MailItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
outlookmail.To =";
字符串地址= outlookmail.Recipients [1] .Address;
outlookmail.Subject =附加图表";
outlookmail.Body =这是一封发送图表的邮件";
outlookmail.HTMLBody ="这将以粗体显示";
outlookmail.Display(true);

}

但是如何从sqldatabase中检索数据以插入到Outlookmail字段To,subject和Body

怎么做?请告诉我

how to do when we clicked button i want to open the new MailMessage windows which in the outlook by using C# in the windows forms
plz thanks in advance.i find out the code


private void btnoutlookmail_Click(object sender, EventArgs e)
{


Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MailItem outlookmail = (Microsoft.Office.Interop.Outlook.MailItem)outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
outlookmail.To = "";
string address = outlookmail.Recipients[1].Address;
outlookmail.Subject = "Attaching Chart";
outlookmail.Body = "this is a mail for sending chart";
outlookmail.HTMLBody = " This will display in Bold";
outlookmail.Display(true);

}

But how can i retrieve data from sqldatabase to insert into outlookmail fields To,subject and Body

how to do ?plz tell me

推荐答案

查找,提供您的默认电子邮件ID作为链接,并要求用户单击相同的名称,它将打开新的邮箱.您的机器.
我也同意O'Griff的观点.

谢谢,
Ambesha
Freind, Give your default email id as a link and ask user to click on the same it will open the new mail box on your machine.
also I am agree with O''Griff that be specific.

Thanks,
Ambesha


这篇关于C#Windows窗体Outlook邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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