PhpMailer,以其他名称发送附件
我使用phpmailer发送带有附件的电子邮件PhpMailer,以其他名称发送附件,php,email,phpmailer,Php,Email,Phpmailer,我使用phpmailer发送带有附件的电子邮件 file = "/path/bla.csv"; require 'class.phpmailer.php'; $mail = new PHPMailer(); // some oprtions here $mail->AddAttachment($file); $mail->Send(); 因此,如果使用此代码,电子邮件将与附加文件一起发送,文件名为:bla.csv 是否可以在不
file = "/path/bla.csv";
require 'class.phpmailer.php';
$mail = new PHPMailer();
// some oprtions here
$mail->AddAttachment($file);
$mail->Send();
因此,如果使用此代码,电子邮件将与附加文件一起发送,文件名为:bla.csv
是否可以在不重命名真实文件的情况下更改附加文件名?也就是说,我需要发送bla.csv
文件,但发送的是名称some_other_name.csv
怎么做这个 将所需名称作为第二个参数传递
$mail->AddAttachment($file, "newName.csv");