In most cases, mail on the server is configured incorrectly. Emails sent from the server end up in the SPAM folder.
This is highly undesirable email behavior.
Unfortunately, there is no way to resolve this issue programmatically from a sсript (CMS).
For proper email functionality, we recommend using a "domain mail" service from reputable providers that specialize in this feature.
Alternatively, we offer email distribution through specialized services, via API, or with specific plugins.
We can help you set up domain mail, but we will need to request a number of access rights. Due to the security policies of these services, we cannot do this independently without your participation.