This question is more about PHP, rather than WP.
I call built-in function mail()
on a hosting provider. It always returns FALSE
, while on local machine it returns TRUE
.
<?php
$result = mail(...);
var_dump($result) // always false on a provider machine;
So I know and expect that mail()
shouldn’t work on a host machine. But when installing a WP from a package, it somehow sends “Welcome to WordPress” mail from the domain it runs on.
The core code of WP is a pure mess, and it’s not that easy to read and understand it. But when exploring it I noted that it uses mail()
function to send welcome mails. So what I’m asking is how WP magically configures that mail()
function to send mails?
WordPress’s
wp_mail()
function uses PHPMailer.