flashx Posted November 6, 2010 Share Posted November 6, 2010 Hi guys, this is my first post, and im needing some help with email and variables in php. when i save this out it works: <?php $test = "hi there"; mail('myemail@mythingy.com.au','test subject', 'This is a test'); ?> but as soon as i add variable into the mix it doesnt work... <?php $email = "myemail@mythingy.com.au"; mail($email,'test subject', 'This is a test'); ?> any clues? Quote Link to comment Share on other sites More sharing options...
Adam Posted November 6, 2010 Share Posted November 6, 2010 Do you get an error, or do you just not receive the email? Quote Link to comment Share on other sites More sharing options...
Rifts Posted November 6, 2010 Share Posted November 6, 2010 try this mail( '$email' ,'test subject', 'This is a test'); Quote Link to comment Share on other sites More sharing options...
Adam Posted November 6, 2010 Share Posted November 6, 2010 Variables within single quotes aren't parsed. Quote Link to comment Share on other sites More sharing options...
Rifts Posted November 6, 2010 Share Posted November 6, 2010 well thats the only way it works on my computer Quote Link to comment Share on other sites More sharing options...
Adam Posted November 6, 2010 Share Posted November 6, 2010 Sorry but you're wrong. Perhaps you're using double-quotes? 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.