添加如下配置,记得username要与前面的password sender 一样
$wgSMTP = [
'host' => 'mail.example.com', // could also be an IP address. Where the SMTP server is located. If using SSL or TLS, add the prefix "ssl://" or "tls://".
'IDHost' => 'example.com', // Generally this will be the domain name of your website (aka mywiki.org)
'localhost' => 'example.com', // Same as IDHost above; required by some mail servers
'port' => 587, // Port to use when connecting to the SMTP server
'auth' => true, // Should we use SMTP authentication (true or false)
'username' => 'my_user_name', // Username to use for SMTP authentication (if being used)
'password' => 'my_password' // Password to use for SMTP authentication (if being used)
];