Issue when Delay Sending from Outbox

Add-in Express™ Support Service
That's what is more important than anything else

Issue when Delay Sending from Outbox
 
John Parsons




Posts: 10
Joined: 2020-07-21
When a User has the "Options > Advanced > Send Immediately when connected" option unselected the email becomes un-sendable.
I believe this is similar to https://www.add-in-express.com/forum/read.php?FID=5&TID=14330 and https://www.add-in-express.com/forum/read.php?FID=1&TID=5081&MID=25312#message25312 that I found in the forum.
I have added the following line to all adxOutlookEvents_XXX Events

var outboxid = OutlookApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox).EntryID;
var currentFolder = OutlookApp.ActiveExplorer().CurrentFolder.EntryID;
if (outboxid == currentFolder)
{
 return;
}

I do see it hitting this code block and returning without accessing this Item, but it still is not sent.
Is there something else I need to be doing to get these emails to send from the outbox?
Thank you!
John
Posted 24 Nov, 2020 11:57:15 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Hello John,

The best way is to check MailItem.Submitted: if it's true, don't touch the email. The point is: emails may be sent in a number of ways so that the MailItem.Submitted is the only way to check if an email is about to be sent. Even the Outbox may contain submitted and non-submitted items.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 24 Nov, 2020 12:37:19 Top
John Parsons




Posts: 10
Joined: 2020-07-21
I have added that check (below), but the items in the Outbox are still being unsent when I open and click send.

if(e.Item is Outlook.MailItem)
            {
                Outlook.MailItem mail = (Outlook.MailItem)(e.Item);
                if (mail.Submitted)
                    return;
            }
Posted 24 Nov, 2020 13:33:08 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Hello John,

I was assuming this scenario: there's an email waiting for the next send in the Outbox; you open the Outbox and see the email shown in italic; you select the email (for tests, you'd better have two such emails) and it looses italic (it becomes drawn using a normal font). In other words, I supposed you talked about the SelectionChange event.

Now it appears you use a different event. What event are you using? Also, are you sure your add-in produces this issue? Make sure other COM add-ins are turned off.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Nov, 2020 00:54:21 Top
John Parsons




Posts: 10
Joined: 2020-07-21
Hi Andrei,
Here is the scenario:
I create an email and click send. It gets sent to the Outbox. When I double click and open the email from the outbox and click send from there. It just stays in the outbox and doesn't get sent.
When I disable my add-in, the email gets sent when I do the same steps.
Posted 25 Nov, 2020 09:23:35 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Hello John,

I assume this is still relates to handling the ExplorerSelectionChange event in the code of your add-in. To verify this put two emails to the Outbox and check the effects described in my previous post: the font used to display the email differs if the email is submitted or not. I assume the code of the ExplorerSelectionChange event gets the email and checks something: doing this on a submitted email makes the email non-submitted and it hangs in the Outbox.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Nov, 2020 09:53:31 Top
John Parsons




Posts: 10
Joined: 2020-07-21
Hi Andrei,
I changed my ExplorerSelectionChange event to the following to rule stuff out:

private void adxOutlookEvents_ExplorerSelectionChange(object sender, object explorer)
{
   return;
}


I tried the two emails, read/resent one and I do see different fonts- One bold, the other not.(similar to if one had been read or not) But both remain in the outbox.
Posted 25 Nov, 2020 10:14:53 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Hello John,

Check the Submitted property on both emails. For an email to get sent, that property must be true.

John Parsons writes:
But both remain in the outbox.


That is, you click Send and the emails remain intact? Could you capture a video showing how this looks like?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 26 Nov, 2020 02:38:57 Top
John Parsons




Posts: 10
Joined: 2020-07-21
Hi Andrei,
the Submitted property is set to to true when i click send. but still remains in the outbox.
I have sent a video to the support email with the URL of this thread as the subject.
Please let me know your thoughts.
Thank you
Posted 30 Nov, 2020 09:33:43 Top
Andrei Smolin


Add-in Express team


Posts: 17502
Joined: 2006-05-11
Hello John,

Thank you for the video. Will the email send if you click the Send / Receive button?

Disabling the "Options > Advanced > Send Immediately when connected" option means that the Send/Receive process won't start *immediately*. It will start either at a scheduled moment or when you click the Send/Receive button. There's one more option that may postpone sending emails: tab Send/Receive, group Send/Receive Groups, item Disable Scheduled Send/Receive - if this item is checked, your only way to send an email is to click the Send/Receive button.

The Send/Receive schedule is defined in tab Send/Receive, group Send/Receive Groups, button Define Send/Receive Groups.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 30 Nov, 2020 10:25:30 Top