我已在本地设置Wordpress,我正在尝试使用此功能发送电子邮件:
$key = get_password_reset_key($user);
$url = \'http://frontend.web.node.net/reset-password?token=\' . $key;
$to = $param[\'email\'];
$subject = \'Passord reset\';
$body = \'Du kan tilbakestille passordet ditt på denne lenken\' . $url;
$headers = array(\'Content-Type: text/html; charset=UTF-8\');
$sent = wp_mail($to, $subject, $body, $headers);
if (!$sent) {
return [\'error\' => \'email was not sent\'];
}
return [\'success\' => \'mail has been sent\'];
但是,当我试图发送这样的电子邮件时,电子邮件从未发送过,我做错了什么?