Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Windows
pEp for Outlook
Commits
c2fdc390
Commit
c2fdc390
authored
May 10, 2021
by
Thomas
Browse files
Make sure we have a mail item to show if an error occurs during sending.
parent
981e1624
Changes
1
Hide whitespace changes
Inline
Side-by-side
Extensions/MailItemExtensions.cs
View file @
c2fdc390
...
...
@@ -2151,39 +2151,39 @@ namespace pEp
Outlook
.
MailItem
sendItem
=
null
;
try
{
if
(
sendError
==
false
)
/* If we have an entry id at this point, we are trying to send a message that has been saved during composing and is probably
* stored in the pEp Drafts folder. In this case, get a new handle on the mail item to prevent the "The operation cannot be performed
* because the message has been changed" error during sending.
*/
string
eid
=
omi
.
EntryID
;
if
(
string
.
IsNullOrEmpty
(
eid
))
{
/* If we have an entry id at this point, we are trying to send a message that has been saved during composing and is probably
* stored in the pEp Drafts folder. In this case, get a new handle on the mail item to prevent the "The operation cannot be performed
* because the message has been changed" error during sending.
*/
string
eid
=
omi
.
EntryID
;
if
(
string
.
IsNullOrEmpty
(
eid
))
sendItem
=
omi
;
}
else
{
Outlook
.
Application
application
=
null
;
Outlook
.
NameSpace
session
=
null
;
try
{
application
=
Globals
.
ThisAddIn
.
Application
;
session
=
application
.
Session
;
sendItem
=
session
.
GetItemFromID
(
eid
);
}
catch
(
Exception
ex
)
{
sendItem
=
omi
;
Log
.
Error
(
"ProcessAndSendMessageAsync: Error getting send item. "
+
ex
.
ToString
());
}
else
finally
{
Outlook
.
Application
application
=
null
;
Outlook
.
NameSpace
session
=
null
;
try
{
application
=
Globals
.
ThisAddIn
.
Application
;
session
=
application
.
Session
;
sendItem
=
session
.
GetItemFromID
(
eid
);
}
catch
(
Exception
ex
)
{
sendItem
=
omi
;
Log
.
Error
(
"ProcessAndSendMessageAsync: Error getting send item. "
+
ex
.
ToString
());
}
finally
{
application
=
null
;
session
=
null
;
}
application
=
null
;
session
=
null
;
}
}
if
(
sendError
==
false
)
{
// OUT-713: Prevent second "Empty subject" warning
if
(
string
.
IsNullOrEmpty
(
processedMessage
.
ShortMsg
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment