Click here to Skip to main content
13,000,619 members (64,538 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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";


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

how to do ?plz tell me
Posted 14-Oct-12 20:28pm
Updated 14-Oct-12 23:27pm
OriginalGriff 15-Oct-12 3:10am
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

Member 11505660 12-Mar-15 2:40am
hello, i have windows form application using c# with .net 3.5.
i have used outlook 2007(Microsoft Outlook 12.0 Object Library) calender and appointment in my windows form to insert and display appointment.i have inserted appointment. but now i want to open outlook on my windows form and display appointment. is there any way to open outlook in windows form?
{i am using vs 2010}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170624.1 | Last Updated 15 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100