Can any one tell me if there is a way to select a specific profile without using mapi
.
So far my code looks as shown below:
Outlook.Application app = null;
if (Process.GetProcessesByName("OUTLOOK").Count() > 0)
{
app = Marshal.GetActiveObject("Outlook.Application") as Outlook.Application;
}
else
{
app = new Outlook.Application();
}
Outlook.MailItem mymail = app.CreateItem(Outlook.OlItemType.olMailItem);
mymail.Subject = aSubject;
for (int i = 0; i < (int)atargets.Count(); ++i) mymail.Recipients.Add(atargets[i]);
for (int i = 0; i < (int)aAttach.Count(); ++i) mymail.Attachments.Add(aAttach[i]);
mymail.Body = aBody;
mymail.Importance = Outlook.OlImportance.olImportanceHigh;
mymail.Display(false);
return true;