静默 发表于 2015-9-13 12:56:21

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");
      }
    }
}
页: [1]
查看完整版本: Outlook发信