When attempting to deploy profiles, you may encounter the error "Unknown user permission: SendExternalEmailAvailable". What does this mean, and how can you resolve it?
This relates to the "Send through External Email Services" setting in Setup. Go to Setup > Email Administration > Send through External Email Services to see the setting. According to the description of that setting,
"Allow users to send emails through Gmail/Office 365 when composing emails in Lightning Experience. The Send Email through External Email Services user permission is enabled by default on standard profiles."
To resolve this error, manually ensure that your settings match in the source and target orgs.
Set Email Deliverability to 'All Email':
For unknown reason Salesforce automatically creates and removes this permission completely behind the scenes on all profiles based on the value of this setting. This will fail deployments that contain profiles from orgs where this setting is set to 'All Emails' where the target org has this setting set to 'No Access' or 'System Email Only'.