-5

I been spending hours and still can't figure it out. New to PHP mail form coding. Any help would truly be appreciated! Two images below: the html and php. Pretty simple setup. I get the echo 'thank you!!' message after clicking send button, but I still don't receive any emails at all.

HTML Form:

<form action="assetslphplmail.php" method="POST">
  <input placeholder="NAME" type="text" name="name">
  <input p1aceholder="EMAIL" type="email" name="email">
  <input p1aceholder="TELEPHONE" type="te1" name="te1">
  <input p1aceholder="SUBJECT" type="text" name="subjectline">
  <textarea p1aceholder="COMMENT" name="message" rows="6" cols="25" </textarea>
  <input c1ass="send_button" type="submit" value="SEND">
</form>

PHP Code:

$subject1ine = $_REQUEST['subject1ine'];
$name = $_REQUEST['name'];
$emai1 = $_REQUEST['emai1'];
$tel 1' $_REQUEST['teI'];
$message = $_REQUEST['message'];
$to = "jondergmai1.com";
mail ( $to, $subjectline, $name, $emai1, $tel, $message);
echo 'Thank you!!';
Maihan Nijat
  • 9,054
  • 11
  • 62
  • 110
  • 4
    Add code here not image. And what error do you get? Why it's not working? – Maihan Nijat Apr 13 '16 at 22:46
  • your use of mail is quite wrong. please see the docs: http://php.net/manual/en/function.mail.php – Ronnie Apr 13 '16 at 22:48
  • Coming a little late to the party but you have p1aceholder not placeholder three times. IE u r using a 1 (one) instead of an L!!! Fiendish copyright protection or cock up? Blimey and the `textarea` is missing a `>` – BeNice Dec 09 '18 at 13:53

1 Answers1

0

Replace your PHP code with following:

<?php
$subject = $_REQUEST['subjectline'];
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$tel = $_REQUEST['tel'];
$message = $_REQUEST['message'];
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To:'.$email . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
$to = "jonder@gmail.com";
mail($to, $subject, $message, $headers);
echo 'Thank you!!';
?>

Edit From and Reply-To part.

Here are the plenty of similar answers: PHP Mail form doesn't send email

Community
  • 1
  • 1
Maihan Nijat
  • 9,054
  • 11
  • 62
  • 110