Jump to content

send email function


chewydence

Recommended Posts

Hi Guys,

 

I'm learning php, I checked out some of the websites that shows on creating a contact form/feedback form. I set up my apache server and my mysql( but i dun think it will matter in this case since it's only sending email)

 

I created a feedback.html, sendmail.php below and thankyou.html. I replaced the mail to my own email and I tried to run it at e localhost, it can redirect to the thankyou.html but I didn't receive any email.

 

sendmail.php

<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( "[email protected]", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://localhost/thankyou.html" );
?>

 

feedback.html

<html>
<body>

<form method="post" action="sendmail.php">
  Email: <input name="email" type="text" /><br />
  Message:<br />
  <textarea name="message" rows="15" cols="40">
  </textarea><br />
  <input type="submit" />
</form>

</body>
</html>

 

Which part do I need to correct on in order to get it working?

 

Thanks in advance.  :)

Link to comment
https://forums.phpfreaks.com/topic/171681-send-email-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.