NOTE. GoDaddy transferred all hosting packages to cPanel. Below are detailed instructions for the older GoDaddy interface. The team is still the same.
At the time of this writing on GoDaddy's shared hosting, I could NOT use the following commands: ping, curl, nc, lynx
but i could use: wget
I successfully created a cron job using wget
to load a PHP file containing a mail()
call.
- log in to your GoDaddy account
- click to expand the "Web Hosting" section and find the server you need
- click the "Manage" button (previously it was called "Launch")
- on the "Hosting Information" page in the "Tools" section, click the "Cron Job Manager" button
- on the Cron Task Manager page, click the Create Cron Task button
- enter the name you want and select a frequency (1 hour - most often allowed EDIT: GoDaddy added 15-minute increments to the frequency selection.)
- enter the command below (with your information):
wget http://YOUR_DOMAIN/YOUR_PATH/YOUR_PHP_FILE.php >/dev/null 2>&1
edit: as Leandro noted, this is a method that allows the cron task to call a remote or local resource - see the GoDaddy documentation if you want to call the resource only locally (which is also safer if you perform more confidential tasks))
in the code "YOUR_PHP_FILE.php" all the actions you want to perform and enable the mail()
call (or whatever mail method you would like to use if you configured it correctly).
Using mail()
, the SMTP relay server will already be correctly configured in the "php.ini" file: relay-hosting.secureserver.net
- which can be confirmed with phpinfo()
.
source share