Send mail help please.

Can somebody tell me how to make this exact code send mail? I tested it on my website and it doesn’t send any emails.

[php]<?php
$mailto = "[email protected]";
$charset = “windows-1251”;
$subject = "Site visitor: ".$_POST[‘posName’];
$content = “text/html”;
$message = "Site visitor information:


Name: ".$_POST[‘posName’]
."
E-mail: ".$_POST[‘posEmail’]
."
Country: ".$_POST[‘posCountry’]
."
Phone: ".$_POST[‘posRegard’]
."
Comments: ".$_POST[‘posText’];

$statusError = “”;
$statusSuccess = “”;

$errors_name = ‘Please enter the Name’;
$errors_mailfrom = ‘Please enter the Email’;
$errors_incorrect = ‘The e-mail address you entered does not eppear to be valid.
Your e-mail address should look like [email protected]’;
$errors_message = ‘Please enter the Message’;
$errors_subject = ‘Please enter the Phone’;
$captcha_error = ‘Wrong security code!’;
$send = ‘Thank you for your message’;
?>

<?php $mailto = "[email protected]"; $charset = "windows-1251"; $subject = "Site visitor: ".$_POST['posName']; $content = "text/html"; $message = "Site visitor information:

First Name: ".$_POST['posName'] ."
Last Name: ".$_POST['posName2'] ."
E-mail: ".$_POST['posEmail'] ."
Telephone: ".$_POST['posRegard'] ."
City where jobsite is located: ".$_POST['posText'] ."
want us to e-mail you the free Homeowners Guide To Remodeling: ".$_POST['posBox']; $statusError = ""; $statusSuccess = ""; $errors_name = 'Please enter the First Name'; $errors_name2 = 'Please enter the Last Name'; $errors_telephone = 'Please enter the Telephone'; $errors_city = 'Please enter the City where jobsite is located'; $errors_mailfrom = 'Please enter the Email'; $errors_incorrect = 'The e-mail address you entered does not eppear to be valid.
Your e-mail address should look like [email protected]'; $captcha_error = 'Wrong security code!'; $send = 'Thank you for your message'; ?>[/php]

Ah and here is the other file that has everything else in it

[php]<?php
include(‘kcaptcha/kcaptcha.php’);
session_start();
require_once(“contact_config.php”);
if ($_POST[‘act’]== “y”)
{
if(isset($_SESSION[‘captcha_keystring’]) && $_SESSION[‘captcha_keystring’] == $_POST[‘keystring’])
{

    if (isset($_POST['posName']) && $_POST['posName'] == "")
    {
     $statusError = "$errors_name";
    }
	elseif (isset($_POST['posEmail']) && $_POST['posEmail'] == "")
    {
     $statusError = "$errors_mailfrom";
    }
    elseif(isset($_POST['posEmail']) && !preg_match("/^([a-z,._,0-9])+@([a-z,._,0-9])+(.([a-z])+)+$/", $_POST['posEmail']))
    {
     $statusError = "$errors_incorrect";

     unset($_POST['posEmail']);
    }
    
	elseif (isset($_POST['posText']) && $_POST['posText'] == "")
    {
     $statusError = "$errors_message";
    }

elseif (!empty($_POST))
{
$headers = “MIME-Version: 1.0\r\n”;
$headers .= “Content-Type: $content charset=$charset\r\n”;
$headers .= “Date: “.date(“Y-m-d (H:i:s)”,time()).”\r\n”;
$headers .= "From: “”.$_POST[‘posName’];
$headers .= “X-Mailer: My Send E-mail\r\n”;

mail("$mailto","$subject","$message","$headers");

$_POST[‘posRegard’] = “”;
$_POST[‘posText’] = “”;
$_POST[‘posCountry’] = “”;
$_POST[‘posEmail’] = “”;
$_POST[‘posName’] = “”;

unset($name, $posText, $mailto, $subject, $posRegard, $message);

$statusSuccess = “$send”;
}

   }else{
         $statusError = "$captcha_error";
         unset($_SESSION['captcha_keystring']);
    }

}

$cat_name=“Contact $store_name manager”;[/php]

look at php_mailer

Sponsor our Newsletter | Privacy Policy | Terms of Service