wp_mail函数没有发送电子邮件。我如何解决它?

时间:2021-11-24 15:17:14

Unable to send an email using the below wp_mail function. How do I fix it?

无法使用以下wp_mail函数发送电子邮件。我如何解决它?

wp_mail($email_address,'Welcome!','Your password'.$password);

1 个解决方案

#1


0  

You seem to be missing some required elements. As noted on the WordPress Codex (https://codex.wordpress.org/Function_Reference/wp_mail), you need to have at least a "to", a "subject" and a "message".

你好像缺少一些必需的元素。正如WordPress Codex(https://codex.wordpress.org/Function_Reference/wp_mail)所述,您需要至少拥有“to”,“subject”和“message”。

The Codex example:

食典委的例子:

<?php wp_mail( 'me@example.net', 'The subject', 'The message' ); ?>

I'm not sure what you are trying to accomplish with the "password" part of your example, but you might not be using the right WordPress function?

我不确定你要用你的例子中的“密码”部分来完成什么,但你可能没有使用正确的WordPress功能?

#1


0  

You seem to be missing some required elements. As noted on the WordPress Codex (https://codex.wordpress.org/Function_Reference/wp_mail), you need to have at least a "to", a "subject" and a "message".

你好像缺少一些必需的元素。正如WordPress Codex(https://codex.wordpress.org/Function_Reference/wp_mail)所述,您需要至少拥有“to”,“subject”和“message”。

The Codex example:

食典委的例子:

<?php wp_mail( 'me@example.net', 'The subject', 'The message' ); ?>

I'm not sure what you are trying to accomplish with the "password" part of your example, but you might not be using the right WordPress function?

我不确定你要用你的例子中的“密码”部分来完成什么,但你可能没有使用正确的WordPress功能?