DrTrans Posted August 16, 2009 Share Posted August 16, 2009 I cant get this to send me an email for nothing... Im running windows 2003 with xampp. if($submit){ ini_set("sendmail_from", "[email protected]"); $sendmail = mail('$mainemail', 'Requested Service', '$property'); echo "<BR/>mail() returned: " . ($sendmail? "TRUE" : "FALSE") . "<BR/>"; var_dump($sendmail); echo "$property -- $service --- $extra -- $pay --$mainemail"; } When this script runs.. this is what it produces: mail() returned: TRUE bool(true) Catherine Sim 1716 -- Tester --- -- Rent [email protected] Any help is appreciated Link to comment https://forums.phpfreaks.com/topic/170516-solved-mail-on-winblows-2003-server/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 16, 2009 Share Posted August 16, 2009 Php variables are not parsed when contained inside single-quotes. In the following line of code, '$mainemail' and '$property' are literally the strings ' $ m a i n e m a i l ' and ' $ p r o p e r t y ' - $sendmail = mail('$mainemail', 'Requested Service', '$property'); You don't need any quotes when all you have is a variable. Remove the single-quotes from around those two variables or if you had a need to use them inside of a string with other content, use double-quotes. Link to comment https://forums.phpfreaks.com/topic/170516-solved-mail-on-winblows-2003-server/#findComment-899486 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.