简体   繁体   中英

Sending an email with php from a html page

I am trying to configure this boostrap template: Github link

I do not have a datebase to use and on the Github page it says:

"Your must enter your database information and your email in form-handler.php - if you don't have a database, that's fine. Edit contact.html to direct the form to form-handler-nodb.php and emails will be sent with no database writes."

I do not understand exactly what it means to "direct the form to form-handler-nodb.php". I have tried to change the form attributes in contact.html to be <form action="/form-handler-nodb.php" method="post" role="form"> , but that just results in form-handler-nodb.php being downloaded when I hit the submit button.

My question is then what do I need to change in contact.html to be able to submit the email that is in the form on the page?

This is driving me insane! Thank you for your help.

As Capsule mentioned in the comments I was not running a server when I was testing it locally. By uploading the contact.html to my server I started seeing this working.

As a side note, there was also a mistake in the form-handler-nodb.php file where "\\nEmail: " . $email; "\\nEmail: " . $email; needed to be changed to "\\nEmail: " . $message "\\nEmail: " . $message to actually have the inputed email message submitted.

Thank you for the help Capsule!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM