/*
   send a mail with Outlook
   taken from Example03.cs
*/
private void button1_Click(object sender, EventArgs e)
{
   // start outlook 
   Outlook.Application outlookApplication = new Outlook.Application();

   // create a new MailItem.
   Outlook.MailItem mailItem =
outlookApplication.CreateItem(OlItemType.olMailItem) as Outlook.MailItem; // prepare item and send mailItem.Recipients.Add("eric@cartman.com"); mailItem.Subject = "hello eric"; mailItem.Body = "Season Greetings from NetOffice. Kind Regards - Sebastian"; mailItem.Send(); // close outlook and dispose outlookApplication.Quit(); outlookApplication.Dispose(); }

Last edited Jun 13, 2012 at 9:33 AM by SebastianDotNet, version 4