email - Create and mail temporary pdf in php -


When a button is clicked, a PDF is generated and pdf opens in a web browser. I would like to temporarily store the PDF in one variable and when clicked on the button, it was included as an attachment in the mail.

How am I struggling with saving and enclosing the file?

& lt; One class = "button" href = "http://mydomian.com/pdf001.php" & gt; Send PDF & lt; / A & gt; & Lt ;? From Php $ = 'nobody@example.com'; $ Theme = 'subject'; $ Message = 'hello'; $ Headers = 'From: webmaster@example.com' "\ r \ n" 'Answer: webmaster@example.com' "\ r \ n" 'X-Mailer: PHP /' phpversion (); Mail ($ $ $ $ theme, $ message, $ headers); ? & Gt;

Like a comment under your original post

PHPMailer's Use

  & lt ;? Php require_once ('../ class.phpmailer.php'); $ Mail = new PHPMailer (); // php "mail ()" to use the default $ mail-> AddReplyTo ("name@yourdomain.com", "First Last"); $ Mail- & gt; Setfrum ('name@yourdomain.com', 'First Last'); $ Mail- & gt; AddReplyTo ("name@yourdomain.com", "First Last"); $ Address = "whoto@otherdomain.com"; $ Mail- & gt; AddAddress ($ address, "John Doe"); $ Mail- & gt; Topic = "Send PhD PDF Exam"; $ Mail- & gt; AltBody = "To see the message, please use an HTML compatible email viewer!"; // Optional, comment out and $ mail-> test; MsgHTML ($ body); $ Mail- & gt; Attachfromstring (base 64_ode (file_gate_content ($ urLToPdf)); // Attachment // In your case this will be http://mydomian.com/pdf001.php if (! $ Mail- & gt; send ()) {echo "mailer error:" $ mail & gt; ErrorInfo; } And {echo "Message sent!"; }? & Gt;  

I have edited this code online quickly and think that it can work with each tweaking for each variable.


Comments

Popular posts from this blog

Active Directory Authenticated Proxy Server with Squid or CNTLM -

java - Can't add JTree to JPanel of a JInternalFrame -

java - @PluginTarget(Node.class) not registering as neo4j plugin -