Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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";
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
Posted
Updated 14-Oct-12 23:27pm
v2
Comments
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

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
 
Share this answer
 
Comments
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900