Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Location
    Brisbane Australia
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    PHP Help- receiving email with no form results

    <?php

    /* Subject and Email Variables */

    $emailSubject = 'Web Enquiry';
    $webMaster = 'xxxxxxxxxx@hotmail.com';

    /* Gathering data Variables*/

    $email = $_POST['name'];
    $email = $_POST['phone'];
    $email = $_POST['mobile'];
    $email = $_POST['email'];
    $email = $_POST['suburb'];
    $email = $_POST['time'];
    $email = $_POST['subject'];
    $email = $_POST['source'];
    $email = $_POST['comments'];

    $body = <<<EOD
    <br><hr><br>
    Name: $name <br>
    Phone: $phone <br>
    Mobile: $mobile <br>
    Email: $email <br>
    Surburb: $suburb <br>
    Time: $time <br>
    Subject: $subject <br>
    Source: $source <br>
    Comments : $comments <br>
    EOD;

    $headers = "From: $email\r\n";
    $headers = "Content-type: text/html\r\n";
    $success = mail($webMaster,$emailSubject,$body,$headers);

    /* Results rendered as HTML*/
    $theResults = <<<EOD
    <html>
    <head>
    <title>JakesWorks - travel made easy-Homepage</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    background-color: #f1f1f1;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    color: #666666;
    text-decoration: none;
    }
    -->
    </style>
    </head>

    <div>
    <div align="left">Thank you for your interest! Your email will be answered very soon!</div>
    </div>
    </body>
    </html>
    EOD;
    echo "$theResults";

    ?>

  • #2
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    Looks like you just need to do some Basic Debugging 101 to find your errors, some of which are really obvious
    Last edited by bullant; 05-18-2011 at 04:22 AM.

  • #3
    New Coder
    Join Date
    Mar 2011
    Location
    Texas
    Posts
    22
    Thanks
    0
    Thanked 1 Time in 1 Post
    PHP Code:
    $text="your Text";
    $headers  'MIME-Version: 1.0' "\r\n";
                    
    $headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
                    
    $headers .= 'From: Admin <admin@x.com>' "\r\n";
                    
    $body="User Contacted :"."<p><br> ".$text;
                    
    $ret=mail('sender@gmail.com',"User Contact",$text,$headers); 
    You can use above script, this is very simple. I have tested this and worked without giving any issues

  • Users who have thanked mark1976 for this post:

    webnewbie74 (05-24-2011)

  • #4
    New Coder
    Join Date
    May 2011
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    /* Gathering data Variables*/

    $email $_POST['name'];
    $email $_POST['phone'];
    $email $_POST['mobile'];
    $email $_POST['email'];
    $email $_POST['suburb'];
    $email $_POST['time'];
    $email $_POST['subject'];
    $email $_POST['source'];
    $email $_POST['comments']; 

  • #5
    New to the CF scene
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Looks like the dreaded "cut-and-paste" gremlin at work here
    Last edited by k1L0VoLt; 05-20-2011 at 03:54 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •