Start a Chat Sales: 0800 862 0890 Client Area
Results 1 to 11 of 11

Thread: PHP Warning: mail() has been disabled

  1. #1
    bcomputr is offline Junior Member
    Join Date
    May 2012
    Location
    Wembley, London
    Posts
    10

    Default PHP Warning: mail() has been disabled

    Hey, I have a PHP script on my hosting for my contact page. All it does is send the mail to an email address. I set up a testing version of my site under a subdomain where i test ot my updates but when i send a test email i get an error log with :

    [15-Jun-2012 21:04:34 UTC] PHP Warning: mail() has been disabled for security reasons in /home/kraziene/public_html/beta/emailer.php on line 17

    Any ideas on how to fix this

    Thanks

  2. #2
    whUK-Reeve's Avatar
    whUK-Reeve is offline Support Team
    Join Date
    Feb 2010
    Posts
    13

    Default PHP Warning: mail() has been disabled

    Quote Originally Posted by bcomputr View Post
    Hey, I have a PHP script on my hosting for my contact page. All it does is send the mail to an email address. I set up a testing version of my site under a subdomain where i test ot my updates but when i send a test email i get an error log with :

    [15-Jun-2012 21:04:34 UTC] PHP Warning: mail() has been disabled for security reasons in /home/kraziene/public_html/beta/emailer.php on line 17

    Any ideas on how to fix this

    Thanks
    We had disabled the PHP mail() function on our shared and reseller hosting servers some time back and we have already notified all of our clients regarding the same.

    During the server audits, we've found that many spam emails were being sent from the servers using different spamming scripts with the help of PHP mail() function and hence we decided to disable the PHP mail() function..

    Alternative to PHP mail() function is to enable SMTP authentication in your PHP mailer scripts or you can either use PEAR mail or SwiftMailer library, if you want to send emails from your PHP scripts.
    Reeve
    [URL="http://www.webhosting.uk.com"]Webhosting.uk.com[/URL]

  3. #3
    bcomputr is offline Junior Member
    Join Date
    May 2012
    Location
    Wembley, London
    Posts
    10

    Default

    Quote Originally Posted by whUK-Reeve View Post
    We had disabled the PHP mail() function on our shared and reseller hosting servers some time back and we have already notified all of our clients regarding the same.

    During the server audits, we've found that many spam emails were being sent from the servers using different spamming scripts with the help of PHP mail() function and hence we decided to disable the PHP mail() function..

    Alternative to PHP mail() function is to enable SMTP authentication in your PHP mailer scripts or you can either use PEAR mail or SwiftMailer library, if you want to send emails from your PHP scripts.
    Okay, thanks.
    I've done some research into it and I'm not sure how to install it
    IS it as simple as adding the following code to the top of my PHP script ?

    (sorry wouldn't let me post the code :S here is a screenshot) http://grab.by/eeu2

    Thanks
    Last edited by bcomputr; 18-06-12 at 10:24 AM.

  4. #4
    whUK-Reeve's Avatar
    whUK-Reeve is offline Support Team
    Join Date
    Feb 2010
    Posts
    13

    Default

    Quote Originally Posted by bcomputr View Post
    Okay, thanks.
    I've done some research into it and I'm not sure how to install it
    IS it as simple as adding the following code to the top of my PHP script ?

    (sorry wouldn't let me post the code :S here is a screenshot) TinyGrab - Simple. Screenshot. Sharing.

    Thanks
    Yes, you can add that code in your Mailer script to turn on SMTP authentication.
    But please note that the username and password should be the ones created from cPanel control panel.
    Reeve
    [URL="http://www.webhosting.uk.com"]Webhosting.uk.com[/URL]

  5. #5
    bcomputr is offline Junior Member
    Join Date
    May 2012
    Location
    Wembley, London
    Posts
    10

    Default

    Quote Originally Posted by whUK-Reeve View Post
    Yes, you can add that code in your Mailer script to turn on SMTP authentication.
    But please note that the username and password should be the ones created from cPanel control panel.
    Thanks for the quick reply I'm using Gmail, would that effect the outcome or would I just need to use the Gmail settings?

    thanks

  6. #6
    whUK-Reeve's Avatar
    whUK-Reeve is offline Support Team
    Join Date
    Feb 2010
    Posts
    13

    Default

    Quote Originally Posted by bcomputr View Post
    Thanks for the quick reply I'm using Gmail, would that effect the outcome or would I just need to use the Gmail settings?

    thanks
    For SMTP authentication to work, you have to use username and password created from cPanel control panel instead of Gmail email address.

    The very reason for enabling SMTP authentication is to make sure that the emails should be authenticated from the server.
    Reeve
    [URL="http://www.webhosting.uk.com"]Webhosting.uk.com[/URL]

  7. #7
    bcomputr is offline Junior Member
    Join Date
    May 2012
    Location
    Wembley, London
    Posts
    10

    Default

    Quote Originally Posted by whUK-Reeve View Post
    For SMTP authentication to work, you have to use username and password created from cPanel control panel instead of Gmail email address.

    The very reason for enabling SMTP authentication is to make sure that the emails should be authenticated from the server.
    Ah, okay I see Thank you very much for all your help

  8. #8
    whUK-Reeve's Avatar
    whUK-Reeve is offline Support Team
    Join Date
    Feb 2010
    Posts
    13

    Thumbs up

    Quote Originally Posted by bcomputr View Post
    Ah, okay I see Thank you very much for all your help
    You are most welcome Please feel free to update this thread in case you need further assistance.
    Reeve
    [URL="http://www.webhosting.uk.com"]Webhosting.uk.com[/URL]

  9. #9
    bcomputr is offline Junior Member
    Join Date
    May 2012
    Location
    Wembley, London
    Posts
    10

    Default

    Quote Originally Posted by whUK-Reeve View Post
    You are most welcome Please feel free to update this thread in case you need further assistance.
    Hey Reeve

    I've had a go at it but I keep getting an error that says:

    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request.

    I've tried both the SMTP codes:




    Also I should of noted before that I have changed the MX entries so that they send the mail to Gmail.

  10. #10
    whUK-Reeve's Avatar
    whUK-Reeve is offline Support Team
    Join Date
    Feb 2010
    Posts
    13

    Default

    Quote Originally Posted by bcomputr View Post
    Hey Reeve

    I've had a go at it but I keep getting an error that says:

    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request.

    I've tried both the SMTP codes:




    Also I should of noted before that I have changed the MX entries so that they send the mail to Gmail.
    Can you please raise a support ticket from help-desk so that we can investigate further and will keep you updated.
    Reeve
    [URL="http://www.webhosting.uk.com"]Webhosting.uk.com[/URL]

  11. #11
    bcomputr is offline Junior Member
    Join Date
    May 2012
    Location
    Wembley, London
    Posts
    10

    Default

    hey thanks for all your help I have raised a ticket and they have got back to me with the problem. unfortuantly it lead to another HTTP Error 500, which I have also contined to ask about

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
Copyright 2001-2013 Web Hosting UK. All rights reserved.