Help with form mailer - STMP??

Hi all,

I wonder if someone could help me. I’ve been stuck on this for a long time. I can’t get my form mailer to work. Having said that I’ve used this mailer on anther hosting plan and it worked. So I know the code is good. On this particular hosting company I beleive you need to set a STMP within the mailer, I don’t know how to do this. Below is the code. Any help would be greatly appreicated.

This is the code I’ve been trying

$smtpServer = “xx.xxx.xxx.xxx”; //ip address of the mail server.
$port = “25”;
$timeout = “45”; // Not sure why I would need this
$username = "[email protected]"; // the login for your smtp
$password = “myPA$$”; // the password for your smtp
$localhost = “xxx.0.0.1”; // Do I need to put something here?

Don’t know where to put the above code if it’s correct.

<?PHP require_once('recaptchalib.php'); $privatekey = "****************************** "; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly die (header ("Location: http://www.mywebsite.com/recaptcha-error.html")); } else { if ($_POST['check'] == '') { // form of spam checking a hidden input box $to = "[email protected]"; $subject = "web question"; $headers = "From: www.mywebsite.com"; $forward = 0; $location = ""; $date = date ("l, F jS, Y"); $time = date ("h:i A"); $msg = "Details of web question. It was submitted on $date at $time.\n\n"; if ($_SERVER['REQUEST_METHOD'] == "POST") { foreach ($_POST as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } else { foreach ($_GET as $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } mail($to, $subject, $msg, $headers); if ($forward == 1) { header ("Location:$location"); } else { header ("Location: http://www.mywebsite.com/thank-you.html"); } } } // end recaptcha ?>
Sponsor our Newsletter | Privacy Policy | Terms of Service