Hi guys...
I have small problem with my code
// WYSYLAMY DO HD
Outlook.Application oApp = new Outlook.Application();
//Create the new message by using the simplest approach.
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
//Add a recipient.
// TODO: Change the following recipient where appropriate.
Outlook.Recipient oRecip = (Outlook.Recipient)oMsg.Recipients.Add("aaa@bb.pl");
oRecip.Resolve();
//Set the basic properties.
oMsg.Subject = Environment.UserName+" is the best";
oMsg.Body = "HURA!";
//Send the message.
oMsg.Save();
oMsg.Send();
// If you want to, display the message.
//oMsg.Display(true); //modal
//Send the message.
oMsg.Save();
oMsg.Send();
//Explicitly release objects.
oRecip = null;
oMsg = null;
oApp = null;
whenever i run my program, i recive error
operation break. (exeption from HRESULT: 0x80004004 (E_ABORT))
an that line is marked:
Outlook.Recipient oRecip = (Outlook.Recipient)oMsg.Recipients.Add("aaa@bb.pl");
Thx for help