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('[email protected]','test subject', 'This is a test'); ?> but as soon as i add variable into the mix it doesnt work... <?php $email = "[email protected]"; mail($email,'test subject', 'This is a test'); ?> any clues? Link to comment https://forums.phpfreaks.com/topic/217929-email-php-and-variables-eeik/ 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? Link to comment https://forums.phpfreaks.com/topic/217929-email-php-and-variables-eeik/#findComment-1131057 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'); Link to comment https://forums.phpfreaks.com/topic/217929-email-php-and-variables-eeik/#findComment-1131102 Share on other sites More sharing options...
Adam Posted November 6, 2010 Share Posted November 6, 2010 Variables within single quotes aren't parsed. Link to comment https://forums.phpfreaks.com/topic/217929-email-php-and-variables-eeik/#findComment-1131104 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 Link to comment https://forums.phpfreaks.com/topic/217929-email-php-and-variables-eeik/#findComment-1131107 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? Link to comment https://forums.phpfreaks.com/topic/217929-email-php-and-variables-eeik/#findComment-1131109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.