PHP beginner |
|
Hallo,
Ik heb een cronjob ingesteld. Hierin wil ik dat hij een mail stuurd.
De cronjob voert hij ook uit. (ik krijg een error mail dat hij de code niet kan uitvoeren).
Weet iemand of ik iets anders moet doen met de code bij een cronjob...
Dit was de code en eronder de fout.
Bedankt
<?php
$to = 'mijn_email@hotmail.com';
$subject = 'Cronjobs';
$message = 'TEST';
$headers = 'From: noreply@email.nl' . "\r\n" .
'Reply-To: noreply@email.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
<?php $to = 'mijn_email@hotmail.com'; $subject = 'Cronjobs'; $message = 'TEST'; $headers = 'From: noreply@email.nl' . "\r\n" . 'Reply-To: noreply@email.com' . "\r\n" . mail($to, $subject, $message, $headers); ?>
FOUT:
/home/shamrock/public_html/cronjobs.php: line 1: ?php
: No such file or directory
/home/shamrock/public_html/cronjobs.php: line 2: =: command not found
/home/shamrock/public_html/cronjobs.php: line 2:
: command not found
/home/shamrock/public_html/cronjobs.php: line 3: =: command not found
/home/shamrock/public_html/cronjobs.php: line 3:
: command not found
/home/shamrock/public_html/cronjobs.php: line 4: =: command not found
/home/shamrock/public_html/cronjobs.php: line 4:
: command not found
/home/shamrock/public_html/cronjobs.php: line 5: =: command not found
/home/shamrock/public_html/cronjobs.php: line 6: Reply-To: noreply@email.com: command not found
/home/shamrock/public_html/cronjobs.php: line 7: syntax error near unexpected token `('
/home/shamrock/public_html/cronjobs.php: line 7: ` 'X-Mailer: PHP/' . phpversion();
'
/home/shamrock/public_html/cronjobs.php: line 1: ?php : No such file or directory /home/shamrock/public_html/cronjobs.php: line 2: =: command not found /home/shamrock/public_html/cronjobs.php: line 2: : command not found /home/shamrock/public_html/cronjobs.php: line 3: =: command not found /home/shamrock/public_html/cronjobs.php: line 3: : command not found /home/shamrock/public_html/cronjobs.php: line 4: =: command not found /home/shamrock/public_html/cronjobs.php: line 4: : command not found /home/shamrock/public_html/cronjobs.php: line 5: =: command not found /home/shamrock/public_html/cronjobs.php: line 6: Reply-To: noreply@email.com: command not found /home/shamrock/public_html/cronjobs.php: line 7: syntax error near unexpected token `(' /home/shamrock/public_html/cronjobs.php: line 7: ` 'X-Mailer: PHP/' . phpversion(); '
|