Jump to content

[SOLVED] Help with cron


ryy705

Recommended Posts

Hello,

 

I am trying to use cron to send out emails from my site.  Here is what I put in my crontab:

[email protected]
*/5 * * * * /absolute/path/test.php

 

And here is whats in test.php:

<?php
mail('[email protected]','subject','message');
?>

 

test.php is set to 777. But cron is running every five minutes but its failing to execute the php file and sending me error messages. I'll post them below:

 

/absolute/path/test.php: line 1: ?php: No such file or directory

/absolute/path/test.php: line 2: syntax error near unexpected token `'[email protected]','subject','message''

/absolute/path/test.php: line 2: `mail('[email protected]','subject','message');'

 

I have tried this in two different webhosts and got the same result.  Any input and help would be appreciated.  Thank you.

 

Link to comment
https://forums.phpfreaks.com/topic/120574-solved-help-with-cron/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.