September 8, 201412 yr My web form seems to work find when directing to my yahoo email, but when I direct to my Hotmail email it doesn't come through. Any ideas why? <?php $this_form_spam = filter_input(INPUT_POST, 'this_title'); $name = filter_input(INPUT_POST, 'name'); $email = filter_input(INPUT_POST, 'email'); $phone = filter_input(INPUT_POST, 'phone'); $gender = filter_input(INPUT_POST, 'gender'); $subject = filter_input(INPUT_POST, 'subject'); $message = filter_input(INPUT_POST, 'message'); $from = 'FROM: Website Contact Form'; $to = '******@live.com'; $body = "FROM: $name \nEMAIL: $email \nPHONE: $phone \nGENDER: $gender \n\nMESSAGE: $message"; $sent = mail($to, $subject, $body, $from); if ($this_form_spam == "") { if($sent) { header ('Location: ../index.php'); } else { echo '<p>Ah! Try again, please</p>'; } } else { // mock and laugh in the face of spam echo 'POSSIBLE SPAM EMAIL'; } ?>
September 9, 201412 yr Shouldn't the line $from = 'FROM: Website Contact Form'; be an actual email address? That could be why its being rejected.
September 9, 201412 yr Author I did what you said and it work, thank you. Question! How do I change the ugly nameserver name coming in as the from in my inbox?
September 10, 201412 yr Are you using SMTP to authenticate it? I would, to stop it going to junk in the future potentially.
Create an account or sign in to comment