![]() |
Email PDF Attachment Not Working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Email PDF Attachment Not Working (/showthread.php?tid=15652) |
Email PDF Attachment Not Working - El Forum - 02-10-2009 [eluser]Kyle Wiebers[/eluser] I'm trying to attach a pdf file, that gets returned by a helper function, to an email. Here is my code: Code: $this->load->helper(array('form', 'url','process')); and the helper function.... Code: function createPDF() { Code: Unable to locate the following email attachment: %PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream xœ3Rðâ2Ð35W(çr QÐw3T04Ò30PISp êZ*˜[šê™›+„¤(hø%æ¦Z)$¦'¦)$§¤qš¦BHH=�ÒS endstream endobj 1 0 obj <> endobj 5 0 obj <> endobj 2 0 obj << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font << /F1 5 0 R >> /XObject << >> >> endobj 6 0 obj << /Producer (FPDF 1.53) /CreationDate (D:20090210184646) >> endobj 7 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 8 0000000000 65535 f 0000000236 00000 n 0000000424 00000 n 0000000009 00000 n 0000000087 00000 n 0000000323 00000 n 0000000528 00000 n 0000000604 00000 n trailer << /Size 8 /Root 7 0 R /Info 6 0 R >> startxref 707 %%EOF With the attachment line included, there is not a body in the email at all, and without it the body says "Testing the pdf helper". The to fields in the header is just junk input that I put in since the form is un-sanitized. Is there anyway to attach the pdf file returned from the createPDF() function? Email PDF Attachment Not Working - El Forum - 02-11-2009 [eluser]hostcord[/eluser] I think you should try saving the pdf as a temporary file, attaching it, then deleting it. Returning the value of the output method is not a file, simply the content of that file and not a file itself. That's my suggestion, hope it helps! |