0

I am new in php and i am working on my own project in which i have a html form.

When a user fills the form and clicks on submit all the data in form will store in database and also all data send to admin/owner in PDF formate via email.

I successfully store the data in database but, I don't know how could i send a pdf file via email..

I have tried the following code.

$to = 'example@email.com';
$subject = "Website Form Data Email";
$txt = $name .' '. $addr .' '. $snpno.'  ;
$headers = "" . "\r\n" .
mail($to, $subject, $txt, $headers);

Please help me.

Thanks All...

steven
  • 4,868
  • 2
  • 28
  • 58
Moiz Ahmad
  • 144
  • 10

1 Answers1

0

*First you have to generate pdf file. *You can search in google and find some pdf generation plugin for php. Use one of them and create pdf file *And then use php mail to send mail with attachment. Here some code for Send attachments with PHP Mail()

Community
  • 1
  • 1
user3419778
  • 856
  • 3
  • 8
  • 11