mrmossel Posted September 7, 2007 Share Posted September 7, 2007 ive paid for my hosting but the mail() function does not seem to work... i am trying to make a form.... this is the complete file: <?php $to = 'myemail@mybusiness.com'; $subject = $_REQUEST['quote']; $email = $_REQUEST['email'] ; $message = $_REQUEST['comments'] ; $headers = '$email'; $sent = mail($to, $subject, $message, $headers) ; if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } ?> can anyone help PLEASE?!!! thank you... Quote Link to comment https://forums.phpfreaks.com/topic/68403-my-mail-function-does-not-work/ Share on other sites More sharing options...
recklessgeneral Posted September 7, 2007 Share Posted September 7, 2007 Hi, Change your $headers assignment to use double-quotes. Variable expansion doesn't happen inside single quotes: $headers = "$email"; ... or just get rid of the quotes entirely. Regards, Darren. Quote Link to comment https://forums.phpfreaks.com/topic/68403-my-mail-function-does-not-work/#findComment-343976 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.