Contact Form
PHP Backend for the contact form on https://vector.im. Ingests data from the
form and then sends an email to the specified email address. Uses sendmail
to actually send mail.
Setup
Copy sample.config.php
to config.php
and change values as necessary.
Email headers, using variable names from the config file, end up in the form of:
Sender: $to_email
From: John Doe via vector.im <[email protected]>
Reply-To: John Doe <[email protected]>
To: to_name <$to_email>
Ensure you have sendmail
set up correctly on your server and that PHP is able to use it.
Requires PHP 5+.
Usage
contact.php
accepts POST
requires with the query parameters name
, email
and enquiry
.
A 400
is returned if missing query parameters, a 500
is returned if missing config values, and a 200
with message success
is returned on success.