email - Define from php -


i have sendmail.php works great. when trying send mail 2 email adresses , 1 of come variable mail not send. when go:

define("webmaster_email", "luka@luka.com, luka123@luka.com"); 

works fine, bet when try variable error, mail not send.

$mail = "luka123@luka.com"; if (empty($mail)){     define("webmaster_email", "luka@luka.com"); } else {     define("webmaster_email", "luka@luka.com, $mail"); } 

any idea?

here send function

$mail = mail(webmaster_email, $subject, $mail_salji, $headers);  

first thought must because cannot use variable in constant definition. when tested code:

define("webmaster_email1", "luka@luka.com, luka123@luka.com");  echo webmaster_email1;  $mail = 'luka123@luka.com'; define("webmaster_email2", "luka@luka.com, $mail");  echo '<br>'; echo webmaster_email2; 

i got result:

luka@luka.com, luka123@luka.com luka@luka.com, luka123@luka.com 

so problem somewhere else.

ajax can tested. find out ajax call , call ajax page in browser. don't forget switch error reporting on in ajax page.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -