The code for a twelve-factor app makes no distinction between local and third party services. To the app, both are attached resources, accessed via a URL or other locator/credentials stored in the config.
A deploy of the twelve-factor app should be able to swap out a local MySQL database with one managed by a third party (such as Amazon RDS) without any changes to the app’s code.
Likewise, a local SMTP server could be swapped with a third-party SMTP service (such as Postmark) without code changes.
In both cases, only the resource handle in the config needs to change.