Confirmation Email not showing up in GMail
i created email form 2 things: populates mysql db , sends confirmation email person filled out form. works great except 1 thing: confirmation email not showing in gmail. when send outlook accounts or hotmail , yahoo, confirmation arrives without problem. i'm wondering why not working in gmail? have of run problem?
here relevant code:
$editformaction = $_server['php_self'];
if (isset($_server['query_string'])) {
$editformaction .= "?" . htmlentities($_server['query_string']);
}
if (function_exists('nukemagicquotes')) {
nukemagicquotes();
}
// process email
if (array_key_exists('send', $_post)) {
$to = $_request['email'];
$subject = 'registration form';
// expected fields
$expected = array('first_name', 'last_name', 'medtech_id', 'job_title', 'company', 'city', 'state', 'email', 'phone', 'contact_me');
// required fields
$required = array('first_name', 'last_name', 'job_title', 'company', 'city', 'state', 'email', 'phone');
// empty array missing fields
$missing = array();
// assume there nothing suspect
$suspect = false;
// create pattern locate suspect phrases
$pattern = '/content-type:|bcc:|cc:/i';
// function check suspect phrases
function issuspect($val, $pattern, &$suspect) {
// if variable array, loop through each element
// , pass recursively same function
if (is_array($val)) {
foreach ($val $item) {
issuspect($item, $pattern, $suspect);
}
}
else {
// if 1 of suspect phrases found, set boolean true
if (preg_match($pattern, $val)) {
$suspect = true;
}
}
}
// check $_post array , sub-arrays suspect content
issuspect($_post, $pattern, $suspect);
if ($suspect) {
$mailsent = false;
unset($missing);
}
else {
// process $_post variables
foreach ($_post $key => $value) {
// assign temporary variable , strip whitespace if not array
$temp = is_array($value) ? $value : trim($value);
// if empty , required, add $missing array
if (empty($temp) && in_array($key, $required)) {
array_push($missing, $key);
}
// otherwise, assign variable of same name $key
elseif (in_array($key, $expected)) {
${$key} = $temp;
}
}
}
// go ahead if not suspect , required fields ok
if (!$suspect && empty($missing)) {
// build message
$message = 'sample message: hello! registered!';
$message = wordwrap($message, 70);
$additionalheaders = 'from: registration form on web site';
if (!empty($email)) {
$additionalheaders .= "\r\nreply-to: $email";
}
$mailsent = mail($to, $subject, $message, $additionalheaders);
if ($mailsent) {
}
}
}
i've never seen or heard of before.
is there chance they're getting caught kind of spam or junk mail filters?
More discussions in Develop server-side applications in Dreamweaver
adobe
Comments
Post a Comment