Developer

Developer

  • NA
  • 9
  • 12.9k

Problem with Sending Email using Outlook Express 6

Mar 7 2011 4:59 AM

Hi

My Winforms application need to send email using Outlook Express, since not all client will be having Outlook 2007.  My question is Microsoft.Office.Interop.Outlook can used to handle Outlook  2007 only or it can also be used to Outlook Express ? 

The Code which I am Using is As Bellow. (This code i got from this forum member Only)

Outlook.Application outLookApp = new Outlook.Application();
Outlook.NameSpace objNameSpace = outLookApp.GetNamespace("MAPI");
Outlook.MAPIFolder objFolder = objNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.MailItem mailItem = (Outlook.MailItem)outLookApp.CreateItem(Outlook.OlItemType.olMailItem);
mailItem.To = strEmailTo;
mailItem.CC = strCC;
mailItem.BodyFormat = Outlook.OlBodyFormat.olFormatPlain;
mailItem.Body = strBody;
mailItem.Subject = strSubject;
mailItem.Send();

Answers (2)