Hey,
Ik wil een gegenereerde bijlage (een pdf bestand dat gegenereerd wordt door het aanroepen van een php bestand) meezenden als bijlage bij een e-mail. Nu gebruik ik hiervoor PHPMailer, maar wanneer ik het volgende doe krijg ik de foutmelding "Could not access file: profielpdf.php?id=497":
Ik gebruik TCPDF om in het bestand profiel.php een pdf te creëren. Is het überhaupt mogelijk om met phpmailer een dynamisch gegenereerd pdf bestand te verzenden per mail?
In het bestand TCPDF kan ik de output zetten op:
* I: send the file inline to the browser. The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
* D: send to the browser and force a file download with the name given by name.
* F: save to a local file with the name given by name.
* S: return the document as a string. name is ignored.
Echter geen één van allen werkt in combinatie met PHPMailer.
Heeft iemand een idee waar dit aan kan liggen? Ik heb ook geprobeerd om de addStringAttachment te gebruiken (in profielpdf.php de output ook op string (S) gezet), maar dat werkt helaas niet
.
Ik wil een gegenereerde bijlage (een pdf bestand dat gegenereerd wordt door het aanroepen van een php bestand) meezenden als bijlage bij een e-mail. Nu gebruik ik hiervoor PHPMailer, maar wanneer ik het volgende doe krijg ik de foutmelding "Could not access file: profielpdf.php?id=497":
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
| <? require 'phpmailer/class.phpmailer.php'; try { $mail = new PHPMailer(true); //New instance, with exceptions enabled $body = 'Testemail'; $mail->IsSMTP(); // tell the class to use SMTP $mail->SMTPAuth = true; // enable SMTP authentication $mail->Port = 25; // set the SMTP server port $mail->Host = "mail.*******.nl"; // SMTP server $mail->Username = "*******"; // SMTP server username $mail->Password = "*******"; // SMTP server password $mail->From = "*******"; $mail->FromName = "*******"; $to = "*******"; $mail->AddAddress($to); $mail->Subject = "Tesemail"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; $mail->WordWrap = 80; // set word wrap $mail->MsgHTML($body); $mail->IsHTML(true); // send as HTML $mail->AddAttachment('profielpdf.php?id=497','Profiel.pdf','base64','application/octet-stream'); $mail->Send(); echo 'Message has been sent.'; } catch (phpmailerException $e) { echo $e->errorMessage(); } ?> |
Ik gebruik TCPDF om in het bestand profiel.php een pdf te creëren. Is het überhaupt mogelijk om met phpmailer een dynamisch gegenereerd pdf bestand te verzenden per mail?
In het bestand TCPDF kan ik de output zetten op:
* I: send the file inline to the browser. The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
* D: send to the browser and force a file download with the name given by name.
* F: save to a local file with the name given by name.
* S: return the document as a string. name is ignored.
Echter geen één van allen werkt in combinatie met PHPMailer.
Heeft iemand een idee waar dit aan kan liggen? Ik heb ook geprobeerd om de addStringAttachment te gebruiken (in profielpdf.php de output ook op string (S) gezet), maar dat werkt helaas niet