Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ผมใช้ dompdf ในการสร้าง pdf เพื่อส่งเมล์ ส่งเมล์1 เมล์ ได้ แต่เข้า Loop ส่งเมล์ แล้วมันตายที่ $dompdf->render(); อ่ะครับ



 

ผมใช้ dompdf ในการสร้าง pdf เพื่อส่งเมล์ ส่งเมล์1 เมล์ ได้ แต่เข้า Loop ส่งเมล์ แล้วมันตายที่ $dompdf->render(); อ่ะครับ

 



Topic : 113659



โพสกระทู้ ( 586 )
บทความ ( 0 )



สถานะออฟไลน์




ผมใช้ dompdf ในการสร้าง pdf เพื่อส่งเมล์ ส่งเมล์1 เมล์ ได้ แต่เข้า Loop ส่งเมล์ แล้วมันตายที่ $dompdf->render(); อ่ะครับ

พอวน loop ที่ 1 มันส่งเมล์ได้น่ะครับ มีเอกสาร pdf แนบปกติ

แต่วน loop ที่ 2 มันตายที่ $dompdf->render(); ควรแก้อย่างไรดี



Code (PHP)
// Get the contents of the pdf into a variable for later
				ob_start();
				//require_once("sendmail/pdf.php");
				require_once("../sendmail/pdf_tour.php");
				$pdf_html = ob_get_contents();
				print_r($pdf_html);
				ob_end_clean();
				
				// Get the contents of the pdf into a variable for later
				ob_start();
				//require_once("sendmail/pdf.php");
				require_once("../sendmail/pdf_tour_client.php");
				$pdf_html_client = ob_get_contents();
				print_r($pdf_html_client);
				ob_end_clean();
				
				// Load the dompdf files
				//require_once("sendmail/dompdf/dompdf_config.inc.php");
				require_once("../sendmail/dompdf/dompdf_config.inc.php");
		
				$dompdf = new DOMPDF(); // Create new instance of dompdf
				$dompdf->load_html($pdf_html); // Load the html
				$dompdf->render(); // Parse the html, convert to PDF
				$pdf_content = $dompdf->output(); // Put contents of pdf into variable for later
				
				$dompdf_client = new DOMPDF(); // Create new instance of dompdf
				$dompdf_client->load_html($pdf_html_client); // Load the html
				$dompdf_client->render(); // Parse the html, convert to PDF
				$pdf_content_client = $dompdf_client->output(); // Put contents of pdf into variable for later

// Get the contents of the HTML email into a variable for later
				ob_start();
				//require_once("sendmail/html.php");
				require_once("../sendmail/html_tour.php");
				$html_message = ob_get_contents();
				ob_end_clean();
				
				// Get the contents of the HTML email into a variable for later
				ob_start();
				//require_once("sendmail/html.php");
				require_once("../sendmail/html_tour_client.php");
				$html_message_client = ob_get_contents();
				ob_end_clean();
				
				// Load the SwiftMailer files
				//require_once("sendmail/swift/swift_required.php");
				require_once("../sendmail/swift/swift_required.php");
		
				$mailer = new Swift_Mailer(new Swift_MailTransport()); // Create new instance of SwiftMailer
				$mailer_client = new Swift_Mailer(new Swift_MailTransport()); // Create new instance of SwiftMailer


Code สำหรับส่งเมล์ ครับ ที่มีปัญหาครับ



Tag : PHP









ประวัติการแก้ไข
2015-01-07 20:10:22
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-01-07 20:09:31 By : nut_ch31 View : 1276 Reply : 2
 

 

No. 1



โพสกระทู้ ( 586 )
บทความ ( 0 )



สถานะออฟไลน์


แก้ได้ล่ะครับ ใช้ include แทน require_once






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-01-07 22:08:08 By : nut_ch31
 


 

No. 2



โพสกระทู้ ( 318 )
บทความ ( 1 )



สถานะออฟไลน์
Twitter Facebook


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-01-07 22:58:56 By : LAGO
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ผมใช้ dompdf ในการสร้าง pdf เพื่อส่งเมล์ ส่งเมล์1 เมล์ ได้ แต่เข้า Loop ส่งเมล์ แล้วมันตายที่ $dompdf->render(); อ่ะครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่