Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    4
    Member #
    36373

    Post Help please!! Urgent! PHP form NOT going to inbox.

    For some reason I have this PHP form that I had put together which I thought was going to inbox which still is not. The form processes but every e-mail goes to the inbox. The only time it goes to the inbox is only if I'm launching it and testing the form through my PC. If somebody could help me fix this problem I'll heck even make a paypal donation to you because this has been driving me stupid crazy. I had paid a local web company to put together the form and it seems it works but not sending to write location. This form is for my best friend / client website so that is why I sort of need it fixed ASAP. She's starting to get pretty impatient so. I also have the HTML form code just below.

    PHP Code:
    <?php

    $where_form_is
    ="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

    session_start();

    if( (
    $_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {

        if(
    $_POST['subject']=='1')
        {
            
    $to="kevra83@gmail.com";
            
        }
        
    $to="kevra83@gmail.com";
        
    $subject 'Form Submission';
        
    $message "Visitor  Message

                    First Name: " 
    $_POST['firstname'] ."\r\n""
                    Last Name: " 
    $_POST['lastname'] ."\r\n""
                    Phone Number: " 
    $_POST['phone'] ."\r\n""
                    Email Address: " 
    $_POST['email'] ."\r\n""
                    Comments.: " 
    $_POST['comment'] ."\r\n""
                
                        
                    Sent to you by contact form."
    ;
        
        
    $headers 'From: kevra83@gmail.com' "\r\n" .
        
    'X-Mailer: PHP/' phpversion();

    mail($to$subject$message$headers);


    include(
    "contact.html");
    }
    else {
    echo 
    "Invalid Captcha String, please resubmit form and type in the image.";
    }

    ?>

    HTML Code:
    <div id="left">
          <div id="contact_form">
            <h1>Contact </h1>
            <p>Please fill out the information below.</p>
            <form method="post" action="formm.php" name="Customer Service Form">
      <input type="hidden" name="subject" value="Customer Service Inquiry">
     
      <input type="hidden" name="redirect" value="../thankyou.php">
    <table width="550" border="0" align="center" cellpadding="0" cellspacing="6" class="style10">
      <tr>
        <td colspan="2"><b>*Denotes required fields:</b> </td>
      </tr>
      <tr>
        <td class="colorRed" colspan="2"></td>
      </tr>
      <tr>
        <td  colspan="2"> </td>
      </tr>
      <tr>
        <td width="319" ><div align="right"><b>*</b> First Name: </div></td>
        <td width="433" ><input type="text"  maxlength="40" size="18" value="" name="firstname" id="firstname" /></td>
      </tr>
      
      <tr>
        <td ><div align="right"><b>* </b>Last Name: </div></td>
        <td ><input type="text"  maxlength="40" size="18" value="" name="lastname" id="lastname" /></td>
      </tr>
      
      <tr>
        <td ><div align="right"><b>* </b>Phone Number: </div></td>
        <td ><input type="text"  maxlength="10" size="10" value="" name="phone" id="phone" /></td>
      </tr>
      
      <tr>
        <td ><div align="right"><b>* </b>Email Address: </div></td>
        <td >
          <input type="text"  maxlength="100" size="18" value="" name="email" id="email" />    </td>
      </tr>
      <tr>
        <td  colspan="2"> </td>
      </tr>
      <tr>
        <td><div align="right">Comments</div></td>
        <td><textarea cols="50" rows="8" wrap="virtual" maxlength="1000" name="comment" id="comment"></textarea></td>
      </tr>
      <tr>
        <td  colspan="2"> </td>
      </tr>
      <tr class="bodywhite_text">
        <td valign="top" class="bodytext3"><label class="formFieldQuestion"> 
          <div align="right">Type the image*&nbsp;<a class="info" href="#"><img src="tip_small.png" alt="For security purposes, please type the letters in the image." border="0" /></a><br />
            <img src="CaptchaSecurityImages.php" /> </div>
          </label></td>
        <td valign="top"><input id="captchaForm" name="security_code" class="mainForm" type="text"/></td>
      </tr>
      <tr>
        <td ></td>
        <td ><input name="Submit" type="submit" onclick="MM_validateForm('email','','RisEmail');return document.MM_returnValue" value="Submit" /></td>
      </tr>
    
    </table>
    </form></div>
          <div id="message_sent" style="display:none;">
            <h1>Your message has been sent</h1>
            <p>We'll contact you in a shortest possible time.</p>
            <p>You can now <a href="#" class="read-more">go back</a> to home page.</p>
          </div>
        </div>
    Last edited by kevra83; Jun 12th, 2013 at 11:17 AM.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    What do you mean by testing it through your PC?
    Do you have your own server?

    And you are sure that the emails are not getting put into a filtered in-box/ spam box/ junk mail box?


  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Is it ending up in a spam folder or not getting through at all? It may very well be that you're triggering a GMail spam rule since you're trying to send from your kevra83@gmail.com account without authenticating to it first. It's theoretically possible for anyone to use a script to "send email" from any email address if authentication isn't required.

    How do you use authentication with gmail for a PHP contact form? - Stack Overflow <-- I'm a PHP hack, but the first answer looks like it could do the trick for you.

    The other option you have is to set up an email address on your friend's server for the sole purpose of sending script-based emails and see if that works. You may also require authentication for this as well, depending on how your friend's host is set up.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    Junior Member
    Join Date
    May 2013
    Posts
    4
    Member #
    36373
    It's going through just fine but It's going straight to the spam folder. The gmail one I'm using is just for my test e-mail. Her e-mail is an actually a yahoo account so I don't know how much helps. But everything is going to her junk e-mail. My friends host is under godaddy. How would I set up the script based e-mails on her Mac or PC?

  6. #5
    WDF Staff veraderock's Avatar
    Join Date
    Jun 2011
    Posts
    172
    Member #
    28229
    Liked
    22 times
    Since you're hard-coding a "From:" address, you could just have your friend add that same address to their contact list. And if there's an option to "Mark Not Spam", then do that as well.

    Aside for making DNS changes, that's the best you'll get.

    The problem is that mail servers are trying to be smarter about avoiding spam, so they look for what's called an "SPF" record in the domain name for the sending user. In your example you are sending from yourself "kevra83@gmail.com", so mail servers would look at the DNS for Gmail.com, check the "SPF" record and see which servers are allowed to send mail. I guarantee your desktop is not included in that list.

    So your options are
    a) add the "From" address email to your contact list and hope that's good enough to end up in your Inbox.
    b) update the form to send through Google's mail servers, (or Yahoo's, if the "From" were a Yahoo account) this would require an SMPT AUTH mail script which you don't have there, but could be added. Note that there may also be SSL or TLS requirements for this that your webserver would need to support.
    c) use a "From" address with a domain name you own, then update the DNS settings of that domain to include an SPF record allowing your desktop (and live webserver) to send mail from it.

  7. #6
    WDF Staff veraderock's Avatar
    Join Date
    Jun 2011
    Posts
    172
    Member #
    28229
    Liked
    22 times
    Btw, you can find an example of another user that used the PHP/PEAR package "Mail" to send SMPT AUTH emails. This user had problems in their environment, but assuming your webserver meets the right criteria, you may not have the same problem:
    Authenticated SMPT Email

  8. #7
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Quote Originally Posted by kevra83 View Post
    It's going through just fine but It's going straight to the spam folder. The gmail one I'm using is just for my test e-mail. Her e-mail is an actually a yahoo account so I don't know how much helps. But everything is going to her junk e-mail. My friends host is under godaddy. How would I set up the script based e-mails on her Mac or PC?
    That not only doesn't help...it hurts. Yahoo! has a horrible and incredibly inconsistent set of spam filters.

    Here's what I would suggest:

    1) Tell your friend that her business email communication should be sent to (something)@(her domain), not Yahoo! She's probably losing about half of her customer emails right there.

    2) Use the script sending and SMTP authentication script I posted a link to earlier, but for GoDaddy. The GoDaddy SMTP server is relay-hosting.secureserver.net, so that in conjunction with your email username/password should get you where you want to go.

    If not, like veraderock said you should have your friend add the from email address to her contact list.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

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

Search tags for this page

godaddy php mail form not working

Click on a term to search for related topics.
All times are GMT -6. The time now is 04:42 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com