My php code is this :
$email_message .= "Full Name: ".clean_string($full_name)."\r\n";
$email_message .= "Email: ".clean_string($email_from)."\r\n";
$email_message .= "Telephone: ".clean_string($telephone)."\r\n";
$email_message .= "Message: ".clean_string($comments)."\r\n";
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email_to, $email_subject, $email_message, $headers);
header("Location: $thankyou");
?>
<script>location.replace('<?php echo $thankyou;?>')</script>
<?php
}
die();
?>
It is like a feedback form. I get the name, email, telephone and message from the visitor. Then I used php mail()
function to send these details to my email.(the $email_to
variable is in another file which I integrated with this file). When I try to fill out the form and send it, the mail is not reaching my id. Then i heard of SMTP used to send emails.
but I couldn't make out how to integrate SMTP (my id is in GMail. so smtp.gmail.com) in this coding. Help appreciated