Jump to content

php wont email my form


cmgweb

Recommended Posts

I have the code echoing into the next page where it says your mail was sent successfully but it wont email me all the variables here is the code:

<!DOCTYPE HTML>

<html>

<head>

<meta charset="utf-8">

<title>Submitted Form</title>

</head>

 

<body>

<?php

session_start();

  echo "<html>

        <head><title>Posted Variables</title></head>

        <body>";

$to = "[email protected]";

$subject = "SCE SONGS ORDER FORM";

$email = $_REQUEST['email'];

  foreach ($_POST as $field => $value)

  {

    echo "$field = $value<br>";

  }

$headers = "From: $email";

$sent = mail($to, $subject, $message, $headers) ;

if($sent)

{print "Your mail was sent successfully"; }

else

{print "We encountered an error sending your mail"; }

?>

</body>

</html>

 

please help me out if you need anything else just ask....my email is [email protected]

Link to comment
https://forums.phpfreaks.com/topic/262323-php-wont-email-my-form/
Share on other sites

 <?php
session_start();
  echo "<html>
        <head><title>Posted Variables</title></head>
        <body>";
$to = "[email protected]";
$subject = "SCE SONGS ORDER FORM";
$email = $_REQUEST['email'];
$message="";
  foreach ($_POST as $field => $value)
  {
     $message .="$field = $value<br>";
  }
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
</body>
</html>

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.