JediKnight2
11-19-2008, 11:11 PM
PHP Issue...WIERD
OK..I am scratching my head on this one..I have this PHP form that sends fields to this php file.
Code:
<?php
$to = "email@email.com,email@anotherdomain.com";
$subject = "Demo Viewed";
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$ip_address = $_SERVER['REMOTE_ADDR'] ;
$message = "Name: $name\nEmail: $email\nIP: $ip_address" ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
header("Location: demothankyou.html");
else
{print "We encountered an error sending your mail"; }
?>
This gets sent to both email addresses successfully, notice the $to variable has two different emails at two different domains, both domains hosted on the same server. NOW this is where it gets WEIRD...I change the form to this
Code:
<?php
$to = "email@email.com,email@anotherdomain.com";
$subject = "AMS Demo Viewed";
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$ip_address = $_SERVER['REMOTE_ADDR'] ;
$message = "Name: $name\nEmail: $email\nIP: $ip_address" ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
header("Location: demothankyou.html");
else
{print "We encountered an error sending your mail"; }
?>
All I did was add "AMS" to the subject and only the second email address gets it...even if I take OUT the second email address...the first one will not receive it. If I change the email to the second email and leave the subject...the mail is delivered...IT MAKES NO SENSE! The weirder thing is I can change the subject to ANYTHING ELSE...but if I have AMS in there it will not deliver to that first email...ONLY the second..like I said..even if I put ONE email address..it STILL won't deliver to the first email address...
OK..I am scratching my head on this one..I have this PHP form that sends fields to this php file.
Code:
<?php
$to = "email@email.com,email@anotherdomain.com";
$subject = "Demo Viewed";
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$ip_address = $_SERVER['REMOTE_ADDR'] ;
$message = "Name: $name\nEmail: $email\nIP: $ip_address" ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
header("Location: demothankyou.html");
else
{print "We encountered an error sending your mail"; }
?>
This gets sent to both email addresses successfully, notice the $to variable has two different emails at two different domains, both domains hosted on the same server. NOW this is where it gets WEIRD...I change the form to this
Code:
<?php
$to = "email@email.com,email@anotherdomain.com";
$subject = "AMS Demo Viewed";
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$ip_address = $_SERVER['REMOTE_ADDR'] ;
$message = "Name: $name\nEmail: $email\nIP: $ip_address" ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
header("Location: demothankyou.html");
else
{print "We encountered an error sending your mail"; }
?>
All I did was add "AMS" to the subject and only the second email address gets it...even if I take OUT the second email address...the first one will not receive it. If I change the email to the second email and leave the subject...the mail is delivered...IT MAKES NO SENSE! The weirder thing is I can change the subject to ANYTHING ELSE...but if I have AMS in there it will not deliver to that first email...ONLY the second..like I said..even if I put ONE email address..it STILL won't deliver to the first email address...
