I use simple php to process sending form inputs arrays using localhost server. Now I need to switch to defined mail server like Gmail SMTP to handle sending process.
<?php
$to = "contact@mail.com";
$from = $_REQUEST['email'];
$name = $_REQUEST['name'];
$headers = "From: $from";
$subject = "[Contact form] You have a message from $name.";
$fields = array();
$fields{"name"} = "Name";
$fields{"email"} = "Email";
$fields{"phone"} = "Phone";
$fields{"department"} = "Department";
$fields{"message"} = "Message";
$body = "Here is what was sent:
"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s
",$b,$_REQUEST[$a]); }
$send = mail($to, $subject, $body, $headers);
?>