我正在尝试在我的prestashop邮件中添加.pdf或.csv附件,但无法正常工作
我已经尝试过一个pdf文件和一个.csv文件,但都无法正常工作。这是我的代码
include('../config/config.inc.php');
require_once(dirname(__FILE__).'/../init.php');
$file_attachment=array();
$content = file_get_contents(_PS_ROOT_DIR_.'/_leptis/PDF_20121109_2.pdf');
$file_attachment['content'] = $content;
$file_attachment['name'] ='RandomPDF';
$file_attachment['mime'] = 'application/pdf';
Mail::Send((int)(Configuration::get('PS_LANG_DEFAULT')), // defaut language id
'contact', // email template file to be use
'Export auto commandes du xxxxxxx', // email subject
array(
'{email}' => Configuration::get('PS_SHOP_EMAIL'), // sender email address
'{message}' => 'This is a test message.', // email content
),
'd.dave@gmail.com', // receiver email address
null, //Receiver name
Configuration::get('PS_SHOP_EMAIL'), //Sender email
Configuration::get("PS_SHOP_NAME"), // Sender name
$file_attachment, //Attachment
null, //SMTP mode
_PS_MAIL_DIR_, //Mails directory
true //Die after error?
);
发送带有消息的邮件,但不发送附件。我真的不知道我在做什么错。有什么帮助吗?