Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (23 sloc) 981 Bytes

Send PDF document as email attachment using PHP

The full tutorial can be foud @

Import data

Import books.sql into your MySQL This will create necessary tables and insert sample data into it.

Change the settings

The following settings need to be changed at config.php

  define('DATABASE_HOST', "localhost");
  define('DATABASE_NAME', "demos");
  define('DATABASE_USERNAME', "root");
  define('DATABASE_PASSWORD', "root");

  define('ATTACHED_FILENAME', "books.pdf");


  define('FROM', "");
  define('TO', "");
  define('SUBJECT', "The title");
  define('CONTENT', "The content");

Run the program

Copy the project into your PHP servers root directory and access the index.php

This should create the PDF page and display it in the browser.