简体   繁体   English

wordpress wp_mail动态附件

[英]wordpress wp_mail dynamic attachments

i am able to send an e-mail using the wp_mail function. 我能够使用wp_mail函数发送电子邮件。 Now I want to send an attachment with it, which link is dynamically. 现在,我想随其发送附件,该附件是动态链接。 Is this possible with the function? 该功能可以吗?

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

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

Thank you very much! 非常感谢你!

This is wp_mail function. 这是wp_mail函数。 Before give $attachments as parameter check it is array() or not then used it. 在给$ attachments作为参数之前,检查它是array()还是不使用。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM