我使用以下代码:
add_filter( 'wp_mail_content_type', 'set_html_content_type');
function set_html_content_type() {
return 'text/html';
}
$headers = 'From: xxxn <info@xxx.co.in>' . "\r\n";
$subject = 'Your Axxxxrship 2017';
$msg = 'Dear '.ucfirst($get_s[0]->name)."<br/><br/>
Thank You for taking intrest in Scholarship 2017. We have recieved Payment from you. Please find the admit card for your Future
reference. <br/><br/>
Thanks & Regards<br/>
xxxxxx
";
$up = __DIR__ . '/menu-pages/admit_card/'.$stid.'.pdf';
$mail_attachment = array($up);
wp_mail($to, $subject, $msg, $headers,$mail_attachment);
remove_filter( 'wp_mail_content_type', 'set_html_content_type');
但我正在尝试发送邮件。邮件发送成功,但我没有收到邮件中的任何附件。
我如何追踪问题是什么。发送文件的路径是:
/home/xcdx/public_html/wp-content/plugins/schloarship/menu-pages/admit_card/20108.pdf