SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Website Contact Form not working, clueless about any error.

    Hello,

    I am new in this forum and I came here with a hope of help. I am working on my own small business website and I am stuck on the Contact Form part. I got a free template, I am working on the content and other part perfectly. But the contact form is sending any mail to my email address. I am able to fill it completely, but there is no email coming in my email address even after editing that form.

    Following is the SendContact.PHP form :

    <?php

    $from = "info@XXXXX.com";
    $from_name = "DesignHQ";
    $subject = "Contact Form";

    $to = $_POST['email'];

    // collect data
    $body = "";
    foreach($_POST as $key => $val)
    {
    if($key != 'captcha')
    $body .= ucfirst($key).": ".$val."\r\n";
    }

    // construct MIME PLAIN Email headers
    $header = "MIME-Version: 1.0\n";
    $header .= "Content-type: text/plain; charset=utf-8\n";
    $header .= "From: $from_name <$from>\r\nReply-To: $from_name <$from>\r\nReturn-Path: <$from>\r\n";

    // send email
    $mail_sent = mail($to, $subject, $body, $header);
    ?>


    ======================================================================

    I am really clueless about fixing it. Please help me

    Regards,

    Jatin

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,189
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Is this just a contact us form that will send an email to you?

  3. #3
    SitePoint Member
    Join Date
    May 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, It is.

    I got the solution, it is working now.

    Thanks Btw....

  4. #4
    SitePoint Member
    Join Date
    May 2010
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see that you have solved your problem. I'm only posting out of interest because I've just had the same problem with my site. Was this a problem with your PHP code or was it (like mine) related to mail configuration and firewall issues?

  5. #5
    SitePoint Member
    Join Date
    May 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the very late reply. It was a problem in my PHP code.


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
  •