Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.
Please keep in mind:
$to = 'somemail@fakemail.com';
$mail->Mailer = "smtp";
$mail->Host = ""; // SMTP host
$mail->SMTPAuth = true;
$mail->Username = "";
$mail->Password = "";
There was an error sending your request. Please try again later
Please fill correct all the form fields.
if ($_POST['name'] and $_POST['email'] and $_POST['message']) {
$result = true;
$name = $_POST['name'];
$email = trim($_POST['email']);
$message = $_POST['message'];
$to = 'ACA COLOQUE MI CORREO @gmail.com';
$subject = 'Contact form example';
$mailbody .= "Name: ".$name."\n";
$mailbody .= "E-mail: ".$email."\n\n";
$mailbody .= "Message: ".$message."\n\n";
$mailbody .= "IP: ".getenv("REMOTE_ADDR")."\n";
$mailbody .= "Browser: ".getenv("HTTP_USER_AGENT")."\n\n";
$use_phpmailer = false; // true: uses php mailer | false: uses the default mail() function
// We are going to check the fields...
if(check_email_address($email) and check_value($name) and check_value($message)) {
// Waht are we using?
if($use_smtp) {
// Hail PHPMailer!
require_once __CHV_PATH_CLASSES__ . 'class.phpmailer.php';
$mail = new phpmailer();
$mail->Mailer = "mail";
$mail->Host = ""; // SMTP host
$mail->SMTPAuth = true;
$mail->Username = "";
$mail->Password = "";
$mail->Timeout = 30;
$mail->From = $email;
$mail->FromName = $name;
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->Body = $mailbody;
$success = $mail->Send();
} else {
$success = mail($to, $subject, $mailbody); // $to, $subject, $mailbody
}
// Succes true...
if($success) {
$output = 'Form submited, we will contact you soon.';
$contact_class = 'contact-ok';
} else { // Oh no... errors.
$output = 'There was an error sending your request. Please try again later.';
$contact_class = 'contact-error';
}
} else { // Invalid values...
$output = 'Please fill correct all the form fields.';
$contact_class = 'contact-error';
}
}
?>