Even with the addition of value="" (null) to the HTML form field code, I still can't leave the email form field blank, which is what I want. I want them to have the option of submitting an email address or a phone number, or both at once.
I'm getting this error from the server if I submit phone number only:
"Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content in D:\hosting\7762152\html\contact.php on line 32"
What do I add to the php code to allow a blank email field?
<?php
$to = "name@domain.com";
$from = $REQUEST['email'] ;
$phone = $REQUEST['phone'] ;
$headers = "From: $from";
$subject = "Web Contact Data";
$fields = array();
$fields{"schedule"} = "Schedule";
$fields{"pricing"} = "Pricing";
$fields{"proof"} = "Proof-of-Concept";
$fields{"email"} = "Email Address";
$fields{"phone"} = "Phone Number";
$body = "We have received the following information:\r\n";
foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\r\n",$b,$_REQUEST[$a]); }
/* SMTP Injection */
$from = urldecode($from);
if (eregi("\r",$from) || eregi("\n",$from)){
die("Spammer detected");
}
/* End SMTP Injection */
else {
$send = mail($to, $subject, $body, $headers);
if($send)
{header( "Location: thankyou.html" );}
else
{print "We encountered an error sending your mail, please notify name@domain.com"; }
}
?> [/COLOR]
Thanks!