Php 如何将使用TCPDF创建的pdf附加到mailto链接?
我想将使用TCPDF创建的pdf文件附加到我的电子邮件中 我就是这样做的:Php 如何将使用TCPDF创建的pdf附加到mailto链接?,php,pdf,tcpdf,mailto,Php,Pdf,Tcpdf,Mailto,我想将使用TCPDF创建的pdf文件附加到我的电子邮件中 我就是这样做的: $fileatt = $pdf->Output('file.pdf', 'E'); header("Location: mailto:someone@somepage.com?subject=my report&attachment=".$fileatt."&body=see attachment"); 但我收到一条错误消息警告:标题不能包含多个标题 更新: Fred-ii-建议使用快捷邮件
$fileatt = $pdf->Output('file.pdf', 'E');
header("Location: mailto:someone@somepage.com?subject=my report&attachment=".$fileatt."&body=see attachment");
但我收到一条错误消息警告:标题不能包含多个标题
更新:
Fred-ii-
建议使用快捷邮件解决此问题:
$fileatt=$pdf->Output('quote.pdf','E')
但我仍然不知道如何将它与mailto结合使用phpmailer。一旦头球开火,你就无能为力了;这是附加文件。在邮件功能中执行。@Fred ii-我不知道php邮件程序。用“mailto”是不可能的?也许吧;查看此(外部)线程或,以获取可能不起作用的解决方案或答案。但我建议您使用phpmailer/swiftmailer进行此操作,这将更容易,这样您就不会向可能的垃圾邮件发送者显示电子邮件,我将尝试使用swiftmailer。我希望这对mailto有效
require_once 'swiftmailer/lib/swift_required.php';
// Create the mail transport configuration
$transport = Swift_MailTransport::newInstance();
// Create the message
$message = Swift_Message::newInstance();
$message->setTo(array(
"someone@somewhere.com" => "Someone",
));
$message->setSubject("This email is sent using Swift Mailer");
$message->setBody("You're our best client ever.");
$message->setFrom("someone@somewhere.com", "Your bank");
// Send the email
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
$message->attach(
Swift_Attachment::$fileatt);