我有一个自定义产品表单查询创建,其所有数据都通过AJAX发送。问题是虽然我包含了wp函数的wp-load.php
文件和pluggable.php
函数的wp_email
文件,但它仍然显示错误:
致命错误:调用未定义的函数wp_email()
这是我在发送电子邮件查询的文件夹中的inquire.php的代码:
require('../wp-load.php');
require('../wp-includes/pluggable.php');
$to = 'email@email.com';
$subject = 'Product Inquiries';
$message = '
<table width="99%" cellspacing="0" cellpadding="1" border="0" bgcolor="#eaeaea">
<tbody>
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="5" border="0" bgcolor="#ffffff"><tbody>
<tr bgcolor="#eaf2fa">
<td colspan="2"><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><strong>Name</strong></font></td>
</tr>
<tr bgcolor="#ffffff">
<td width="20"> </td>
<td><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px">'.$your_name.'</font> </td>
</tr>
<tr bgcolor="#eaf2fa">
<td colspan="2"><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><strong>Email Address</strong></font></td>
</tr>
<tr bgcolor="#ffffff">
<td width="20"> </td>
<td><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><a target="_blank" href="mailto:'.$your_email.'">'.$your_email.'</a></font>
</td>
</tr>
<tr bgcolor="#eaf2fa">
<td colspan="2"><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><strong>Phone</strong></font></td>
</tr>
<tr bgcolor="#ffffff">
<td width="20"> </td>
<td><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px">'.$your_phone.'</font> </td></tr>
<tr bgcolor="#eaf2fa">
<td colspan="2"><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><strong>Product Link</strong></font></td>
</tr>
<tr bgcolor="#ffffff">
<td width="20"> </td>
<td><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><a target="_blank" href="'.$prod_link.'">'.$prod_name.'</a></font></td>
</tr>
<tr bgcolor="#eaf2fa">
<td colspan="2"><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><strong>Message</strong></font></td>
</tr>
<tr bgcolor="#ffffff">
<td width="20"> </td>
<td><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px">'.$your_message.'</font>
</td>
</tr>
<tr bgcolor="#eaf2fa">
<td colspan="2"><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px"><strong>Referred By:</strong></font></td>
</tr>
<tr bgcolor="#ffffff">
<td width="20"> </td>
<td><font style="FONT-FAMILY:sans-serif;FONT-SIZE:12px">'.$referred_by.'</font>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>';
wp_email($to,$subject,$message);
请帮帮我们..谢谢..