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?
Pass the desired name as second parameter
$mail->AddAttachment($file, "newName.csv");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With