D
Dale Franks
I have a C# Windows Forms application that I am developing. I am running
into a problem sending mail via Outlook 2007. The application is being
developed in VS2008. I work in a DoD (Navy) environment, where I have no
control over the security settings for Outlook. The code is very simple:
Outlook.Application oApp = new Outlook.Application();
Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
Outlook.MAPIFolder oOutboxFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox);
oNameSpace.Logon(null, null, false, false);
Outlook._MailItem oMailItem =
(Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
oMailItem.To = "(e-mail address removed)";
oMailItem.Subject = cboSubject.Text;
oMailItem.Body = txtMessage.Text;
oMailItem.Send();
In the application I am developing, the email DOES get sent through Outlook
2003, after the user approves the mail on the security dialog box. In 2007,
however, the Send() function results in the error:
Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
In the Outlook 2007 Trust Center, the Programmatic Access security setting
is set to "Warn me about suspicious activity when my antivirus software is
inactive or out of date (recommended)", which, although I cannot change it in
the Outlook interface, seems to me to be the appropriate level of security.
I really don't care if the security dialog box appears or not. It does
appear in Outlook 2003, and the user can approve the message. That's fine.
What I don't understand is why Office 2007 refuses to either send the email,
or provide a security dialog box for the user to approve it. I can save the
email. I can move it into the Outbox, or anywhere else. I can display the
email, and have the user manually click the send button. But I can't
actually send the email.
Since the rest of the organization is scheduled to upgrade to Office 2007 in
the near future, this is a matter of some pressing interest for me.
Any suggestions?
into a problem sending mail via Outlook 2007. The application is being
developed in VS2008. I work in a DoD (Navy) environment, where I have no
control over the security settings for Outlook. The code is very simple:
Outlook.Application oApp = new Outlook.Application();
Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI");
Outlook.MAPIFolder oOutboxFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox);
oNameSpace.Logon(null, null, false, false);
Outlook._MailItem oMailItem =
(Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
oMailItem.To = "(e-mail address removed)";
oMailItem.Subject = cboSubject.Text;
oMailItem.Body = txtMessage.Text;
oMailItem.Send();
In the application I am developing, the email DOES get sent through Outlook
2003, after the user approves the mail on the security dialog box. In 2007,
however, the Send() function results in the error:
Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))
In the Outlook 2007 Trust Center, the Programmatic Access security setting
is set to "Warn me about suspicious activity when my antivirus software is
inactive or out of date (recommended)", which, although I cannot change it in
the Outlook interface, seems to me to be the appropriate level of security.
I really don't care if the security dialog box appears or not. It does
appear in Outlook 2003, and the user can approve the message. That's fine.
What I don't understand is why Office 2007 refuses to either send the email,
or provide a security dialog box for the user to approve it. I can save the
email. I can move it into the Outbox, or anywhere else. I can display the
email, and have the user manually click the send button. But I can't
actually send the email.
Since the rest of the organization is scheduled to upgrade to Office 2007 in
the near future, this is a matter of some pressing interest for me.
Any suggestions?