我正在使用FPDF创建pdf .Pdf产生完美,pdf也可通过电子邮件发送.但我也想发送正文消息.我尝试过身体信息.示例精细文本消息This is text message from shohag但只有pdf附件可用且正文为空.这是我的代码.
function send_pdf_to_user(){
if($_REQUEST['action'] == 'pdf_invoice' ){
require('html2pdf.php');
$pdf=new PDF_HTML();
$pdf->SetFont('Arial','',11);
$pdf->AddPage();
$text = get_html_message($_REQUEST['eventid'], $_REQUEST['userid']);
if(ini_get('magic_quotes_gpc')=='1')
$text=stripslashes($text);
$pdf->WriteHTML($text);
//documentation for Output method here: http://www.fpdf.org/en/doc/output.htm
$attach_pdf_multipart = chunk_split( base64_encode( $pdf->Output( '', 'S' ) ) );
//define the receiver of the email
$to = 'monirulmask@gmail.com';
//define the subject of the email
$subject = 'Test Invoice';
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate …Run Code Online (Sandbox Code Playgroud)