• GoDaddy Community
  • Websites + Marketing | Website Builders
  • Websites + Marketing | Website Builders

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution
    New

    My PHP mail() form stopped working without modifying anything

    A custom PHP based contact form I've had online for almost 10 years stopped working a few months ago apparently.  I have not modified the site or the script.  Did godaddy change something that broke my mailer?  Please let me know what I need to do to get this working again.  I have a few client sites with more advanced forms that use mail() which are probably also broken.  Not a happy customer.

      

    Thanks,

    15 REPLIES 15

    Re: My PHP mail() form stopped working without modifying anything

    Do you have a bounce back message which might help narrow down the exact problem. Sometimes mail could be bouncing as a result of malware / blacklist / filters once you have a bounce message you should be able to identify which one. 

     

    If you are unable to obtain one contact support to check the logs.

     

     

    Mike L. | WebPro
    Anonymous
    Not applicable

    Re: My PHP mail() form stopped working without modifying anything

    Hi @Mikro,

    you haven't updated your site or your script in ten years? Seriously to keep a site running well maintenance is a must. 

    if your site is outdated I think ten years was a good run. I don't think godaddy can be held responsible, and an update is probably needed. 

    New

    Re: My PHP mail() form stopped working without modifying anything

    I tried checking the logs but every time I click on "View Logs" i get redirected to a dead link.  I'm using the Classic Deluxe Package.  I'm more familiar with cPanel, if i switch my hosting plan from linux classic deluxe to linux deluxe web (newer) will anything else stop working or is it really just the back end that changes?

    New

    Re: My PHP mail() form stopped working without modifying anything

    Let me rephrase that, I've been updating the site frequently, however I have not changed the line of code executing the mail() function in about 3 or 4 years as it is still valid according to http://php.net/manual/en/function.mail.php  10 was an exaggeration out of my frustration with this place.

     

    Helper VI Helper VI
    Helper VI

    Re: My PHP mail() form stopped working without modifying anything

    @Mikro,

    Can you run a separate mail script with error reporting and tell us the message?

    What is your basis that it is not working?  Did you stop receiving emails?

     

    There are many reasons why mail won't work: script level - typo and stuff, language level -deprecated ,  framework and library level- updates and such, outgoing mail service- is it running properly?, DNS- mx record dkim etc, rDNS- cannot be resolved , incoming mail service, antispamware - A lot of free online web based mail service change their spam criteria once very so often.  Mail service is a pain.   I know  I'm just stating the  obvious here but not knowing any signs and symptoms makes it hard to diagnose.  As far as GoDaddy changes, IDK.  Just like @Amadeuslopezart mentioned... malware might have infected your site that would cause your site info to be blocked.

     

    Used services like this to see if you're black listed: https://sitecheck.sucuri.net/

    ~Jan Mykhail Hasselbring Web Administrator @ fullstackwebsolution.com
    New

    Re: My PHP mail() form stopped working without modifying anything

    @JHasselbring thank you very much for your information.

    New
    Solution

    Re: My PHP mail() form stopped working without modifying anything

     

    The update - GOT IT FIXED - I've found out that godaddy did tighten up security on the mail() function in December of 2016.  My forms are working again without issue, I ended up changing the forms to post to the stock loaded gdmail.php in everyone's classic hosting root directory instead of my custom mail script, adjusting the recipient address in the "form mail" tab in the godaddy admin area so they would send to that address.  I then set the hidden POST variable in the forms to redirect the traffic to my "thank you" page(s).  All emails are coming through without an issue to gmail, my ISP and the godaddy hosted addresses.  The downside to this fix is you can only specify one address in the "form mail" tab, which is ok for me but may not be so elegant for other folks.

     

    Good luck everyone and thanks for your help.

    Helper V

    Re: My PHP mail() form stopped working without modifying anything

    @Mikro, I hope you don't mind a suggestion. I know you have it working now and are unlikely to want to fix something that is now not broken but the PHP mail class is relatively simple and therefore can  cause extra problems. It is better to use a plugin that provides better error checking. You seem to have not been informed of problems with mail and that is a problem worth fixing if you have not already.

    New

    Re: My PHP mail() form stopped working without modifying anything

    @SamHobbs what would I use the plugin for?  I code my sites by hand and don't use wordpress or similar CMS.  What plugin do you suggest? 

    Helper V

    Re: My PHP mail() form stopped working without modifying anything

    @Mikro, when I said "PHP mail class" I meant PHP: mail. I guess that if you check the return value and if it is false then use error_get_last to report the error then that is good. I have seen comments indicating that PHP's mail support is too basic but I seem to have misunderstood.

     

    When I say plugin I meant Pear Mail. There are others but that is the main one.

     

    Since you say you "don't use wordpress or similar CMS" I assume you are not aware of the fact that there are plugins for PHP.

     

    Helper VI Helper VI
    Helper VI

    Re: My PHP mail() form stopped working without modifying anything

    Anyway, @Mikro, since you're a developer,  I recommend using framework and libraries to speed up your development... It will slow down your script execution but it is well worth it in my books.  Look into Laravel as this is the most sought after, enterprise-wise, in the PHP world:  Frameworks puts a structure to your code so that you don't end up with spaghetti code.  It makes your codes readable to you and your team(if ever get to that).  Most problems in PHP has been encountered and solved before, don't reinvent the wheel.  You should also look into managing your own VPS because it gives you full control over what happens to your project.  Main() don't get blocked out of nowhere.  functions do not get deprecated without you knowing.

    ~Jan Mykhail Hasselbring Web Administrator @ fullstackwebsolution.com
    New

    Re: My PHP mail() form stopped working without modifying anything

    @SamHobbs & @JHasselbring thank you both for the excellent info, I will definitely look into these things, especially the pear mail package!  I've been doing things the hard way for far too long.  Thanks for your help.

     

    A moderator can close this thread now as it's been solved and I'm sure we would all love to stop seeing the emails.

     

    Good luck everyone!

    Re: My PHP mail() form stopped working without modifying anything

    Hi, someone please help me.

     

    I set mine up over 5 years ago. It worked all that time. I recently tested it (it doesn't get used all that much), and the e-mails don't come to me anymore. :-(

     

    Upon submission, it takes the user to a Thank You page, but I never get the e-mails.

     

    Please help. It's obviously a setting with GoDaddy, right?

     

    Here is the page: http://www.financialaidfiler.com/Form/form-page.html

    Re: My PHP mail() form stopped working without modifying anything

    Can someone please help?

    Helper V

    Re: My PHP mail() form stopped working without modifying anything

    This question is marked as solved so it is less likely that people will look at it.

     

    Also, although the symptoms are the same or similar, the problem and solution might be different.

    The problem might be with the hosting company or the problem might be with the email server. You don't tell us who is what.

     

    You should get help from PHP specialists for improving your PHP code so that it does show an error message, at least that you can see. If you have used the easiest way to send mail in PHP then you won't get error messages. Other PHP developers here in GoDaddy can probably help but there are other forums that also could help.