Outlook发信

using System;
using Microsoft.Office.Interop.Outlook;

namespace ConsoleApplication1 {
    internal class Program2 {
        private static void Main() {
            var app = new ApplicationClass();
            var mailItemClass = app.CreateItem(OlItemType.olMailItem) as MailItem;
            mailItemClass.To = "rickie.du@sap.com";
            mailItemClass.Subject = "Send File As Email Attachment";
            mailItemClass.Attachments.Add("c:\\a.txt", Type.Missing, Type.Missing, Type.Missing);
            mailItemClass.Send();
            Console.WriteLine("COOL");
        }
    }
}

posted @ 2010-05-07 17:32  飞扬跋扈  阅读(306)  评论(0编辑  收藏  举报