Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2005
    Location
    Tinterweb
    Posts
    555

    Arrow Very strange form submission issue

    I've created an online form for users to submit data, everything was going fine until I checked my gmail account.
    For some reason even though the data is being sent to the specified email address my gmail account is also picking up the emails!

    I've triple checked all my settings and cant work it out. The form should send to [email protected] which it says it is and the email headers confirm this, but as I said they are being sent to my gmail account

    Also used another form processor but the same thing happens, so it must have something to do with my server (cPanel).

    Here is the form processor:

    <?php

    function clean($data)
    {
    return strip_tags($data);
    }

    function checkEmail($email)
    {
    // Create the validation regex
    $regex = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,6})$";

    if (eregi($regex, $email))
    return 1;
    else
    return 0;
    }

    $errors = array();

    if(isset($_POST['submit'])) {

    // If the author was not specified, add an error to the array
    if($_POST['author'])
    $author = clean($_POST['author']);
    else
    $errors[] = "Please tell us your Name";

    // If the email was not specified, add an error to the array
    if($_POST['email'])
    $email = clean($_POST['email']);
    else
    $errors[] = "Please tell us your Email Address";

    // If the email is valid...
    if(!checkEmail($email) && $email)
    $errors[] = "Please specify a valid Email Address";

    if($_POST['number'])
    $number = clean($_POST['number']);

    if($_POST['subscribe'])
    $subscribe = clean($_POST['subscribe']);

    if ($_POST['subject2'])
    $subject2 = clean($_POST['subject2']);
    else
    $errors[] = "Please write a subject";

    if ($_POST['message'])
    $message = clean($_POST['message']);
    else
    $errors[] = "Please write a message for us";

    if ($_POST['security'])
    $security = strtolower(clean($_POST['security']));
    else
    $errors[] = "Please answer the security question";

    if ($security != "blue" && $security)
    $errors[] = "Please answer the security question correctly";

    // Finished building the error array
    if (count($errors>0))
    {
    $errorlist = "<div id=\"form-errors\"><ul>";
    foreach($errors as $error)
    $errorlist .= "<li>$error</li>";
    $errorlist .= "</ul></div>";
    }
    if(!$errors) {
    // Send message
    $to = [email protected]';
    $subject = 'Website Enquiry';
    $from = $author;
    $enquiry = "From: " . $author . "\n" .
    "Email: " . $email . "\n" .
    "Phone: " . $number . "\n" .
    "Subscribe: " . $subscribe . "\n" .
    "Subject: " . $subject2 . "\n" .
    "Message: \n" . $message;
    $headers = "From: $author <$email>\n" .
    "Reply-to: $email" . "\r\n" .
    'X-Mailer: PHP//' . phpversion();

    mail($to, $subject, $enquiry, $headers);

    // Summarise the message for the user
    header('Location: received/');
    }
    }
    ?>
    And the headers:

    from TestName <[email protected]>
    reply-to [email protected]
    to [email protected]
    date Wed, Jul 15, 2009 at 6:24 PM
    subject Website Enquiry
    mailed-by my.server.com
    I dont have a clue why the above is happening, hoping someone on here knows the answer!

    Thanks
    C program run. C program crash. C programmer quit.

  2. #2
    Join Date
    Aug 2001
    Location
    Orange County, CA
    Posts
    532
    Do you happen to have a forwarder in cPanel on your local e-mail account?
    Jeff Standen, Chief of R&D, WebGroup Media LLC. - LinkedIn
    Cerb is a fast and flexible web-based platform for business collaboration and automation. http://www.cerbweb.com/

  3. #3
    Join Date
    Apr 2005
    Location
    Tinterweb
    Posts
    555
    No, all email is handled by an external server separate to the web server.
    C program run. C program crash. C programmer quit.

  4. #4
    Join Date
    Apr 2005
    Location
    Tinterweb
    Posts
    555
    Just had a look at the exim logs:

    2009-07-15 18:24:58 1MR8Dw-0001JL-IT => [email protected] <[email protected]> R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [209.85.222.50]
    2009-07-15 18:24:58 1MR8Dw-0001JL-IT Completed
    Looks like it is sending direct to my gmail account as [email protected]
    C program run. C program crash. C programmer quit.

  5. #5
    check in /et/valiases/<domain.com>

    The forwarder may be present these.

  6. #6
    Join Date
    Apr 2005
    Location
    Tinterweb
    Posts
    555
    Checked the folder and yes it was redirecting to my gmail account, but I now have another problem.
    I removed my gmail account and used: *: :fail: No Such User Here

    Now when I submit the form it keeps trying to send the email internally within the web server, but my emails are handled by an external server.

    Any ideas how to push the emails to the external server?

    Thanks
    C program run. C program crash. C programmer quit.

Similar Threads

  1. Form submission, form data receipt - how to get?
    By tempurr in forum Web Hosting Lounge
    Replies: 3
    Last Post: 07-29-2008, 04:15 PM
  2. strange email form issue
    By vajjas1 in forum Programming Discussion
    Replies: 8
    Last Post: 03-21-2008, 01:01 PM
  3. Form submission help
    By Kleopatra in forum Programming Discussion
    Replies: 3
    Last Post: 07-21-2007, 03:46 AM
  4. Clcik on ad before form submission???
    By designcodes in forum Programming Discussion
    Replies: 4
    Last Post: 06-05-2004, 04:05 PM
  5. Submission Form
    By ve39 in forum Running a Web Hosting Business
    Replies: 2
    Last Post: 06-30-2003, 12:13 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
  •