hi to all !
i’m using a php contact form with image verification than works very well.
so the issue is than a few days ago i was installed my own smtp MTA relay for outgoing mails, so i wish to modify my contact form for send the emails by the specifi smtp host AND PORT.
so here is the code than i’m using…
<?php
if(!$_POST) exit;
$email = $_POST['email'];
$verif_box = $_POST["verif_box"];
if(md5($verif_box).'a4xn' != $_COOKIE['tntcon']){
$error.='Numero antibot erroneo, vuelva a actualizar la pagina';
$errors=1;
}
if(!eregi("^[a-z0-9]+([_\\\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\\.-][a-z0-9]+)*)+"."\\\\.[a-z]{2,}"."$",$email )){
$error.="Email invalido";
$errors=1;
}
if($errors==1) echo $error;
else{
$values = array ('name','email','phone','concerning','message');
$required = array('name','email','message');
$your_email = "theemail@xample.com";
$email_subject = "Formulario example.com";
$email_content = "Nuevo mensaje por formulario :\
\
";
foreach($values as $value){
if(in_array($value,$required)){
if( empty($_POST[$value]) ) { echo 'fill all the fields'; exit; }
$email_content .= $value.': '.$_POST[$value]."\
";
}
}
if(mail($your_email,$email_subject,$email_content)) { setcookie('tntcon',''); echo 'information was sent !';} else { echo 'ERROR!';}
}
?>
i was searched in google for how to specify the host and port for send the email, but i was unable to put in the script for work :S
so any suggestion ?
thanks a lot!
clonick