【发布时间】:2021-03-23 14:37:43
【问题描述】:
if(isset($input->csvrequest)){
$mailsubject= $input->mailsubject;
$mailbody= $input->mailbody;
$mailto= $input->mailto;
$to = $mailto;
$mail_subject = $mailsubject;
$mail_message = $mailbody;
$headers = "From: Test <support@test.com>\r\n";
$headers .= "Reply-To: support@test.com\r\n";
$headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$headers .= "X-Priority: 0\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=win-1251\r\n";
wp_mail($to, $mail_subject, $mail_message, $headers);
add_filter('wp_mail_content_type', create_function('', 'return "text/html"; '));
$arr["error"] = "Email Sent";
}
所以,这段代码正在为我发送邮件。其实我想把这个邮件的附件发送给用户。(例如:file.csv)
【问题讨论】:
-
嗨@Vivek,您的问题很难被复制,而且您对环境的描述也很差。请检查如何提出好的问题。 stackoverflow.com/help/how-to-ask
标签: php export-to-csv email-attachments