本文介绍了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

推荐答案


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

08-06 08:09