Emailing a pdf document...
Posted: Wed Jan 22, 2003 2:06 am
Hi all,
I've successfully coded a script that takes in details specified by the user, populates a pdf document from the form contents and emails a copy of the document back to the user.
The application is for creating online trust deeds, the idea being that using pdf makes it difficult for users to extract the content of the deeds via copy paste.
My problem is that when the email arrives, the pdf document is attached, but it's contents are appended to the message body (which allows users to simply copy/paste, without actually paying for another trust deed.
The mail() code goes...
...where $encoded contains the contents of the pdf document. The script works 100%, aside from letting users copy/paste the content of the pdf document directly from the message body. Anyone got any ideas on how I can the contents being displayed?
Regards,
Ben
I've successfully coded a script that takes in details specified by the user, populates a pdf document from the form contents and emails a copy of the document back to the user.
The application is for creating online trust deeds, the idea being that using pdf makes it difficult for users to extract the content of the deeds via copy paste.
My problem is that when the email arrives, the pdf document is attached, but it's contents are appended to the message body (which allows users to simply copy/paste, without actually paying for another trust deed.
The mail() code goes...
Code: Select all
$strPDFHeader =
"
--THEBOUNDARY-69241
Content-Type: application/octet-stream; name="deed.pdf";
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="deed.pdf"
";
$strFooter =
"
--THEBOUNDARY-69241--
";
$newlineto .= $strPDFHeader.$encoded.$strFooter;
$mailit2 = @mail($email, $F_SUBJECT, $newlineto, $strHeader);Regards,
Ben