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 = "artdept@calmktg.com";

$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 artdept@calmktg.com

Link to comment
Share on other sites

 <?php
session_start();
  echo "<html>
        <head><title>Posted Variables</title></head>
        <body>";
$to = "artdept@calmktg.com";
$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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.