【发布时间】:2012-05-23 07:24:14
【问题描述】:
我正在使用 PHP 邮件功能发送电子邮件,但我想将指定的 PDF 文件作为文件附件添加到电子邮件中。我该怎么做?
这是我当前的代码:
$to = "me@myemail.com";
$subject = "My message subject";
$message = "Hello,\n\nThis is sending a text only email, but I would like to add a PDF attachment if possible.";
$from = "Jane Doe <janedoe@myemail.com>";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent!";
【问题讨论】:
-
[请点击此链接生成动态PDF并发送邮件][1] [1]:stackoverflow.com/questions/18396714/…
标签: email email-attachments php