Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

How to open outlook compose mail from sharepoint 2010 progamaticallly

$
0
0

i want to open outlook compose mail from sharepoint so that i can take the attachments from specfic item in sharepoint list and add it to this compose mail,i tried this code but it only open OUTLOOK process

     
using(SPSite currentSite =newSPSite(SPContext.Current.Site.ID)){using(SPWeb currentWeb = currentSite.OpenWeb(SPContext.Current.Web.ID)){WebURL= currentWeb.Url;
                    currentWeb.AllowUnsafeUpdates=true;SPList correspondences = currentWeb.Lists.TryGetList("list1");SPListItem correspondenceItem = correspondences.GetItemById(id);WebURL= currentWeb.Url;SPAttachmentCollectionCorrespondenceAttachemt= correspondenceItem.Attachments;Microsoft.Office.Interop.Outlook.Application oApp =newMicrosoft.Office.Interop.Outlook.Application();Microsoft.Office.Interop.Outlook._MailItem oMailItem =(Microsoft.Office.Interop.Outlook._MailItem)oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);

                    oMailItem.Body= body;
                    oMailItem.Subject= title;



                    oMailItem.Display();}}

mohamed wasim


Viewing all articles
Browse latest Browse all 13778

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>