Jump to content

[SOLVED] mail() on Winblows 2003 server


DrTrans

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.