SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Email Not Sending

    I'm such a newbie to PHP coding..well...it's pretty pathetic. I'm trying to do the most basic of things, sending an email.

    The page is at: www.anniesphotobooth.com/contact.html

    I copied the code from another website I have where the form mailer is working. I don't understand why email is not being sent from this form. Any help would be appreciated.

    Thanks!

    Chelsea Wilcox

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi Chelsea, can you post the contents of messageSent.php please. We cant help too much without it!!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Addict Phidev's Avatar
    Join Date
    Oct 2008
    Location
    Texas
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be more helpful to see the actual php code rather than the form.

  4. #4
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry Here's the code:

    PHP Code:
    <?php

      $to 
    'chelswilcox@gmail.com';
      
    $subject 'Email from Annies Photo Booth Website';
        
    $headers "From: " $_POST['Email'];
        
    $dates getdate();
        
    $thisDate $dates['month'] . " " $dates['mday'] . ", " $dates['year'];
        
    $message "Form submission from Web site on " $thisDate ": \n\n";

    if (
    $_POST) {
        foreach (
    $_POST as $key => $value) {
          
    $message .= $key ": " $_POST[$key] . "\n";
          }

    $sent mail($to$subject$message$headers);
      }
      
    ?>

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change your form method=POST

    Also, you may want to do a web search on php header injection, because your code is quite vulnerable to spammers.

  6. #6
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much! Should have caught that. I'll do some research.


Bookmarks

Posting Permissions

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