I have a simple script in PHP and FPDI : https://www.setasign.com/products/fpdi/downloads/
So I manually create a PDF and after that I'm trying to send it in email :
$headers = "From: xxxxxxxxxxxx <".$from.">".$eol;
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: multipart/mixed; boundary=\"".$separator."\"";
$message = "--".$separator.$eol;
$message .= "Content-Type: text/html; charset=ISO-8859-1".$eol;
$message .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$message .= $body.$eol;
$message .= "--".$separator.$eol;
$message .= "Content-Type: application/pdf; name=\"".$filename."\"".$eol;
$message .= "Content-Transfer-Encoding: base64".$eol;
$message .= "Content-Disposition: attachment; filename=\"".$filename."\"".$eol;
$message .= $attachment.$eol;
$message .= "--".$separator."--";
// send message
mail($to, "subject", $message, $headers);
When I try to send this email to my gmail account, it's ok, I receive email + pdf.
But if I try to send to a custom email and if I check on Thunderbird for example, my pdf is corrupted, and I get an error like : "This attachment is empty, please check the sender. Firewall or antivirus can destroy attachment"
Any ideas ? What's the problem ? My sender email ? My PHP script ? Other ?
Thanks !