如题。
从outlook2003中拖拽email,让程序获取email的from,to,subject,send.并获取文件的二进制内容。保存为msg文件。
谢谢了

解决方案 »

  1.   

    你可以看下msdn webcast 陈锐老师有讲过关于outlook的一系列课程我还没有时间听不知道里面有没有你需要的东西
    我是通过IReaper下载的。这是系列课程的第一讲http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032328130&EventCategory=3&culture=en-US&CountryCode=US
    其他的你自己找找看
      

  2.   

    public void getEmailInfo()
    {
    Outlook.ApplicationClass outlook = new Outlook.ApplicationClass();
    Outlook.Explorer myExp = outlook.ActiveExplorer();
    Outlook.MailItem myMailItem =null;;
    if(myExp!=null&&myExp.Selection!=null&&myExp.Selection.Count>0)
    {
    try
    {
                                            string To ="";
    myMailItem =myExp.Selection[1] as Outlook.MailItem;
    string SubjectEmail = myMailItem.Subject;
    string From = myMailItem.SenderEmailAddress.ToString();
    string SendDate= myMailItem.ReceivedTime.ToString();
    if(myMailItem.Recipients.Count>0)
    for(int count =1;count<=myMailItem.Recipients.Count;count++)
    To =myMailItem.Recipients[count].Address.ToString()+";"+To;

    string tempEmailFileName =AppDomain.CurrentDomain.BaseDirectory+"temp\\"+System.Guid.NewGuid().ToString().Replace("-","")+".msg";
    myMailItem.SaveAs(tempEmailFileName,Outlook.OlSaveAsType.olMSG);
    string FullPath =tempEmailFileName;
    }
    catch{return null;}
    }
    }