我是 php 新手,并且在构建页面时一直在学习。我当前的任务是能够在浏览器中打开 PDF,填写表单,然后单击表单底部的按钮提交表单。
我们希望发送完整的表格,而无需将副本保存到服务器。不过,拥有两种形式的循环并不可怕。
我目前可以发送电子邮件,但脚本只发送空白文档。
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "xxx.xxx.xxx"; // SMTP server
$mail->From = "xxx@xxx.xxx";
$mail->AddAddress("xxx@xxx.xxx");
$mail->Subject = "Attachment Test";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;
$mail->AddAttachment('tshirtorderform.pdf');
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent.';
}
?>
我意识到我是在告诉它检索空白文档,但我对如何附加已完成的表格一无所知。
谢谢。