Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php wordpress wp_邮件动态附件_Php_Wordpress_Dynamic - Fatal编程技术网

Php wordpress wp_邮件动态附件

Php wordpress wp_邮件动态附件,php,wordpress,dynamic,Php,Wordpress,Dynamic,我可以使用wp_邮件功能发送电子邮件。现在我想用它发送一个附件,它的链接是动态的。该功能是否可以实现这一点 $pdflink = 'http://xxxyyy.com'.$_POST['anhang']; $attachments = array($pdflink); wp_mail( $to, $subject, $message, $attachments ); 多谢各位 这是wp_邮件功能。在将$attachments作为参数之前,请检查它是否为array(),然后使用它 wp_mai

我可以使用wp_邮件功能发送电子邮件。现在我想用它发送一个附件,它的链接是动态的。该功能是否可以实现这一点

$pdflink = 'http://xxxyyy.com'.$_POST['anhang'];
$attachments = array($pdflink);

wp_mail( $to, $subject, $message, $attachments );

多谢各位

这是wp_邮件功能。在将$attachments作为参数之前,请检查它是否为array(),然后使用它

wp_mail( $to, $subject, $message, $headers, $attachments );

你到底是什么意思?请再解释一下。谢谢你的回答!请参考此链接。我认为在您的代码$attachement声明中创建了错误。请把它弄对。