frenly Posted March 8, 2008 Share Posted March 8, 2008 I have a PHP script where I need to use the session variable $_SESSION['username'] to send email to the address contained in the session variable username. The session variable holds valid email address but when i assign the session variable to another variable and try to send email like- $payer_email=$_SESSION['username']; mail($payer_email, "Your order", $pins); , it does not work But when i test the mail function using my email address directly as- mail ("myemail@mail.com", "Your order", $pins), it works Can somebody point me out what my mistake is in this case? Thanks Quote Link to comment Share on other sites More sharing options...
amites Posted March 8, 2008 Share Posted March 8, 2008 echo $_SESSION['username']; Quote Link to comment Share on other sites More sharing options...
frenly Posted March 8, 2008 Author Share Posted March 8, 2008 how do i use this in the mail function? echo $_SESSION['username'] prints the actual email address but when i assign the value to another variable and use it in mail function, it does not work Quote Link to comment Share on other sites More sharing options...
frenly Posted March 8, 2008 Author Share Posted March 8, 2008 so sad noone seems interested to help Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 8, 2008 Share Posted March 8, 2008 there is no obvious problem. it should work as stated. it works for me. Quote Link to comment Share on other sites More sharing options...
uniflare Posted March 8, 2008 Share Posted March 8, 2008 echo $_SESSION['username']; echo the session variable to see if the email address is correct before mailing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.