File tree 5 files changed +1589
-0
lines changed
5 files changed +1589
-0
lines changed Original file line number Diff line number Diff line change
1
+ Fully working PHP/AJAX contact form script is available in the pro version of the template.
2
+ You can buy it from: https://bootstrapmade.com/flexstart-bootstrap-startup-template/
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Requires the "PHP Email Form" library
4
+ * The "PHP Email Form" library is available only in the pro version of the template
5
+ * The library should be uploaded to: vendor/php-email-form/php-email-form.php
6
+ * For more info and help: https://bootstrapmade.com/php-email-form/
7
+ */
8
+
9
+ // Replace contact@example.com with your real receiving email address
10
+ $ receiving_email_address = 'contact@example.com ' ;
11
+
12
+ if ( file_exists ($ php_email_form = '../assets/vendor/php-email-form/php-email-form.php ' )) {
13
+ include ( $ php_email_form );
14
+ } else {
15
+ die ( 'Unable to load the "PHP Email Form" Library! ' );
16
+ }
17
+
18
+ $ contact = new PHP_Email_Form ;
19
+ $ contact ->ajax = true ;
20
+
21
+ $ contact ->to = $ receiving_email_address ;
22
+ $ contact ->from_name = $ _POST ['name ' ];
23
+ $ contact ->from_email = $ _POST ['email ' ];
24
+ $ contact ->subject = $ _POST ['subject ' ];
25
+
26
+ // Uncomment below code if you want to use SMTP to send emails. You need to enter your correct SMTP credentials
27
+ /*
28
+ $contact->smtp = array(
29
+ 'host' => 'example.com',
30
+ 'username' => 'example',
31
+ 'password' => 'pass',
32
+ 'port' => '587'
33
+ );
34
+ */
35
+
36
+ $ contact ->add_message ( $ _POST ['name ' ], 'From ' );
37
+ $ contact ->add_message ( $ _POST ['email ' ], 'Email ' );
38
+ $ contact ->add_message ( $ _POST ['message ' ], 'Message ' , 10 );
39
+
40
+ echo $ contact ->send ();
41
+ ?>
You can’t perform that action at this time.
0 commit comments