I’m a beginner in PHP I was wondering if this is easy to do or if i’d have to outsource this to a programmer –
Basically when a user fills in the PHP Form and submits it I need this to generate as a PDF which will then email/attach to MY email and NOT the user who submitted this form.
I have looked at tcpdf, fpdi but i dont think any of those scripts allow me to do this specifically as from what i heard it generates a download link for the user, and that is not what i need.
If anyone can help me it would be greatly appreciated.
Regards
Tom
You can use FPDF to create a PDF from your data and use FPDF’s Output method which can also returns the generated PDF as a string. So you can take that, encode it as Base64 and create a multi-part message to send the .pdf as an attachment to your inbox.
Here is code copy-pasted from Minimal FPDF tutorial (http://www.fpdf.org/en/tutorial/tuto1.htm )
Now use the default mail() function and create a multi-part message and use these headers for attaching the file to your message.
(assuming you had already defined the required mail headers, multi-part boundary, etc in the $msg string).