I have a form whose action call the following code
processcontactus.php
<?php
function checkEmail($email)
{
if(eregi("[a-zA-Z0-9_]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$]", $email))
{
return FALSE;
}
list($Username, $Domain) = split("@",$email);
if(getmxrr($Domain, $MXHost))
{
return TRUE;
}
else
{
if(fsockopen($Domain, 25, $errno, $errstr, 30))
{
return TRUE;
}
else
{
return FALSE;
}
}
}
@extract($_POST);
$frm_FirstName = stripslashes($frm_FirstName);
$frm_Surname = stripslashes($frm_Surname);
$frm_Email = stripslashes($frm_Email);
$frm_Country = stripslashes($frm_Country);
$frm_Subject = stripslashes($frm_Subject);
$frm_Feedback = stripslashes($frm_Feedback);
if(checkEmail($frm_Email) == FALSE)
{
echo "E-mail entered is not valid.";
}
else
{
mail('example@example.com',"$frm_Subject: $frm_Country",$frm_Feedback,"From: $frm_FirstName $frm_Surname <$frm_Email>");
}
header('Location: http://dev.internetlinked.com/indexpages.php?id=5');
?>
When I try and use it I get
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/intern/public_html/dev/processcontactus.php on line 17
Warning: fsockopen() [function.fsockopen]: unable to connect to :25 in /home/intern/public_html/dev/processcontactus.php on line 17
E-mail entered is not valid.
Warning: Cannot modify header information - headers already sent by (output started at /home/intern/public_html/dev/processcontactus.php:17) in /home/intern/public_html/dev/processcontactus.php on line 42
The above code was obtained from
http://www.spoono.com/php/tutorials/tutorial.php?id=41
The actual page that I'm trying to get to work can be found at
http://dev.internetlinked.com/indexpages.php?id=5
What am I doing wrong?