Is this possible ?(pdf with mail function)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arty
    New Member
    • Nov 2008
    • 35

    #1

    Is this possible ?(pdf with mail function)

    So basically i have:
    a form.php file where a user submit some content , this form.php points to pdf.php file wich shows the content submitted in a pdf file format, so at the same time the pdf appears on this page (pdf.php) i would like to send an email with in attachment the pdf that was created but is this possible ? do i need to use something like OB ?(output buffering control)
    thanks
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by arty
    So basically i have:
    a form.php file where a user submit some content , this form.php points to pdf.php file wich shows the content submitted in a pdf file format, so at the same time the pdf appears on this page (pdf.php) i would like to send an email with in attachment the pdf that was created but is this possible ? do i need to use something like OB ?(output buffering control)
    thanks
    You don't need output buffering. Just do it like this:

    Code:
    $email->send();
    
    $pdf->output();
    Simple.

    Mark.

    P.S. That is pseudo-code.

    Comment

    • arty
      New Member
      • Nov 2008
      • 35

      #3
      ok, but how are you going to attach the pdf if it's not yet displayed or generated ?

      Comment

      • TheServant
        Recognized Expert Top Contributor
        • Feb 2008
        • 1168

        #4
        What about outputting to a file, sending the email, and then redirecting the user to the document?

        Comment

        • arty
          New Member
          • Nov 2008
          • 35

          #5
          yes i outputted to a file on the server and grab the pdf with a fread and added an iframe to the page so the user can see the resulting pdf and has the option of sending it.
          thanks for your reply.

          Comment

          • TheServant
            Recognized Expert Top Contributor
            • Feb 2008
            • 1168

            #6
            Don't like the iframe solution, but glad you got it working.

            Comment

            Working...