3raser Posted November 2, 2009 Share Posted November 2, 2009 Code: <?php $to = $_POST['to']; $title = $_POST['title']; $message = $_POST['message']; $email = $_POST['from']; mail('$to', '$title', '$message', 'From: $email); echo "Email sent to $to from $email, with the title $title."; ?> Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home/a9726309/public_html/emailed.php on line 8 Quote Link to comment https://forums.phpfreaks.com/topic/180017-simple-email-error/ Share on other sites More sharing options...
MadTechie Posted November 2, 2009 Share Posted November 2, 2009 try this <?php $to = $_POST['to']; $title = $_POST['title']; $message = $_POST['message']; $email = $_POST['from']; if(mail($to, $title, $message, "From: $email")){ echo "Email sent to $to from $email, with the title $title."; }else{ echo "Email Failed"; } ?> Note: variables inside single quotes wont get parsed Quote Link to comment https://forums.phpfreaks.com/topic/180017-simple-email-error/#findComment-949719 Share on other sites More sharing options...
3raser Posted November 2, 2009 Author Share Posted November 2, 2009 Email Failed http://webmasters.webatu.com/ Quote Link to comment https://forums.phpfreaks.com/topic/180017-simple-email-error/#findComment-949721 Share on other sites More sharing options...
MadTechie Posted November 2, 2009 Share Posted November 2, 2009 Okay well the email didn't send (but i think you got that) Have you setup your mail server ? check your PHP.ini settings for the SMTP server Quote Link to comment https://forums.phpfreaks.com/topic/180017-simple-email-error/#findComment-949725 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.