Hi I am new to this coding thing and I have created a form in dreamweaver however I wrote the code in PHP but when I test the form and hit submit it returns an error message as follows:
Warning: mail() [function.mail]: SMTP server response: 553 5.3.0 <me@localhost.com>... DISCARD Spam Relay in \HOSTING\DFS\20\7\0\3\2045249307\user\sites\noircreativegroup.com\www\sendresults.php on line 42
I believe I have maybe left something out of the code but what I'm not sure any help would be appreciated. the code for the form is below:
<?php
//--------------------------Set these paramaters--------------------------
// Subject of email sent to you.
$subject = 'Questionare';
// Your email address. This is where the form information will be sent.
$emailadd = 'form@noircreativegroup.com';
// Where to redirect after form is processed.
$url = 'http://www.noircreativegroup.com/thankyou.html';
// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>