Good day
I'm trying to send a PDF attachment via the mail function.
I'm able to send the attachment, but when it gets to the other end the attachment is not a PDF document.
Looks llike a PDF document, but Adobe can't read it.
Here my code:
$to = 'example2@example.com';
$subject = 'Test email with attachment';
$random_hash = md5(date('r', time()));
$headers = "From: example@example.com\r\nReply-To: example@example.com";
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
$attachment = chunk_split(base64_encode(file_get_contents('taghred.pdf')));
What am I missing?
Thanks
Cheers
Ren