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 = '[email protected]'; $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... 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. 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
Archived
This topic is now archived and is closed to further replies.