问题
I use phpmailer for sending email with attachment
file = "/path/bla.csv";
require 'class.phpmailer.php';
$mail = new PHPMailer();
// some oprtions here
$mail->AddAttachment($file);
$mail->Send();
So, if use this code, email is sended with attach file, and file name is: bla.csv
There is possible to change attach file name without renaming real file? that is, I need sent bla.csv
file, but sent is as name some_other_name.csv
How to make this?
回答1:
Pass the desired name as second parameter
$mail->AddAttachment($file, "newName.csv");
来源:https://stackoverflow.com/questions/16776073/phpmailer-sent-attachment-as-other-name