How to determine if email can be sent

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

How to determine if email can be sent
 
Igor Govorov




Posts: 83
Joined: 2014-02-12
We are trying to determine programmatically if an email can be sent:
For example, if user creates new email or makes reply/forward - the email can be sent.
If user opens an email from inbox/send items - it can't be sent.

If user opens msg/eml attachment from another email - it can't be sent - this is the most complicated case.
In this case email can be editable (it is a draft attached to an email), but Send button is disabled.
MailItem.Sent == false for such items.

How can we determine such use case?
Posted 24 Jun, 2015 04:31:34 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Igor,

In this case email can be editable (it is a draft attached to an email), but Send button is disabled.


I have just tested this scenario and found that the following properties have these values:
- EntryID is empty
- Saved = false
- Sent = false
- Parent points to Inbox (not Drafts)

Hope this info will help you detect such cases.
Posted 24 Jun, 2015 05:27:30 Top
Igor Govorov




Posts: 83
Joined: 2014-02-12
For the editable attachment from email in inbox I have following values:
- EntryID is empty
- Saved = true

The same I will have if I'll save new draft as .msg file and then open the .msg.
So this is not reliable way to find if email can be sent.

However, I've found, that I can search for Send button control by its Control Id (0x10A0) in Inspector/Explorer window and then check if it is enabled or not.

Is this a correct solution? Is there any cases, when there is no send button visible in the window, but use can send an email?
Posted 24 Jun, 2015 07:34:46 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Igor,

However, I've found, that I can search for Send button control by its Control Id (0x10A0) in Inspector/Explorer window and then check if it is enabled or not.


Nice solution!

Is this a correct solution?


Of course.

Is there any cases, when there is no send button visible in the window, but use can send an email?


I cannot remember a scenario when the user can send an email when the Send button is disabled or invisible.
Posted 24 Jun, 2015 10:00:08 Top