Jump to content

fpdf and phpmailer


dolcezza

Recommended Posts

I am a newbie at php and trying to generate a pdf, then email it.

If I have the output() line it works fine....prompts me to download the pdf and everything is in there.

 

When I add the mail part I get a blank page in the browser and no email. Any suggestions appreciated.

Only posting relevant part of code

 

require('fpdf.php');
$filename="bookingconfirmation.pdf";
//rest of pdf code here

$pdf->Output($filename);

include "libMail/class.phpmailer.php";
$m= new Mail; // create the mail
$m->IsSMTP(); // telling the class to use SMTP
$m->Host = "mail.connectingauthors.com"; // SMTP server
$m->From("[email protected]");
$m->To("[email protected]");
$m->Subject( "Connecting Authors Booking Confirmation" );
$m->Body( "HellonnPlease find attached ..." ); // set the body
$m->Attach( $filename ) ;
$m->Send(); // send the mail
exit();

Link to comment
https://forums.phpfreaks.com/topic/86414-fpdf-and-phpmailer/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.