Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Programming General (http://siteownersforums.com/forumdisplay.php?f=44)
-   -   How to submit PHP contact form to an email (http://siteownersforums.com/showthread.php?t=172724)

Dubey675 07-08-2016 12:35 AM

How to submit PHP contact form to an email
 
Hello folks,

How to submit PHP contact form to an email.

Alizine 07-08-2016 04:44 AM

Basic PHP email() function code

Below is the code for the basic email function.


Code:

//if "email" variable is filled out, send email
  if (isset($_REQUEST['email']))  {
 
  //Email information
  $admin_email = "someone@example.com";
  $email = $_REQUEST['email'];
  $subject = $_REQUEST['subject'];
  $comment = $_REQUEST['comment'];
 
  //send email
  mail($admin_email, "$subject", $comment, "From:" . $email);
 
  //Email response
  echo "Thank you for contacting us!";
  }
 
  //if "email" variable is not filled out, display the form
  else  {
?>

 

  Email:
  Subject:
  Message:
 
 
 

 
  }
?>


arianagrand 01-29-2020 02:25 AM



















Your name:
Email address:
Comment:



All times are GMT -7. The time now is 03:43 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.