Hi guys, first post here.
I've searched this forum for previous answers to this, but came up short. Hopefully someone here can be kind enough to help.
Ok, so I've managed to get a sendmail script runnning and working well.
It's very basic, goes like this
[INDENT]<?php
$email_to = "example@mysite.com";
$name = $POST["name"];
$email_from = $POST["email"];
$message = $_POST["message"];
$email_subject = "Feedback from website";
$headers =
"From: $email_from .\n";
"Reply-To: $email_from .\n";
$message = "Name: ". $name . "\r\nMessage: " . $message;
ini_set("sendmail_from", $email_from);
$sent = mail($email_to, $email_subject, $message, $headers, "-fexample@mysite.com" .$email_from);
if ($sent)
{
header("Location: http://www.mysite-example.com/thankyou.html");
} else {
echo "There has been an error sending your comments. Please try later.";
}
?>[/INDENT]
Works perfectly & was surprisingly easy to implement.
So my questions are:
Is this script secure from potential spammers? I've been reading up about them hi-jacking the script to send multiple emails etc.
If it's not secure, can someone suggest a way of making it so? By the way, it's hosted on Fasthosts which specifies that i must use an Inbow & Outbox that is also hosted within the site. Not sure if that helps or not.
Thanks in advance.
Shane