Help with php mailing bot

ruicosta

Regular Member
Joined
Nov 23, 2009
Messages
224
Reaction score
27
Hey guys!

I've recently linked my pop mail with gmail account and I'm not happy with the frequency of fetching mails from pop server. As I've read - gmail calculates how often you receive mail and decides how frequent to check. Rule of a thumb is that if you receive your mail every 10 mins - it will check every 5 minutes.

I would like to make a mailing bot which would send email to my pop account every 15 mins, so that gmail would check it every 7 mins and then I could filter those messages in gmail out and delete them.

This is the php script uploaded to my server

Code:
<?php    $to      = '[email protected]';
    $subject = 'Gmail Reminder';
    $message = 'Just a reminder to Gmail to fetch my gmail';
    $headers = 'From: [email protected]' . "\r\n" .
                'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);
?>


and this is a cron job that I've entered in my cpanel:

Code:
*/15  *  *  *  *  php http://www.mydomain.com/mail.php > /dev/null 2>&1

Hosting support says that cron runs normally but I am not getting any emails from it. Only way I can get it to send an email is by visiting mail.php link in my browser.

Any help would be appreciated
 
Code:
*/15  *  *  *  *  php [B][COLOR=#ff0000]http://www.mydomain.com/[/COLOR][/B]mail.php > /dev/null 2>&1

Wrong. You need the absolute path on the file system of the file, not the web address as an argument to php & I 'd also use an absolute path for the php executable as well.
 
Wrong. You need the absolute path on the file system of the file, not the web address as an argument to php & I 'd also use an absolute path for the php executable as well.

Thanks a lot for your help!

Which one is correct?

Code:
php /public_html/MYDOMAIN.COM/mail.php > /dev/null 2>&1

or

Code:
php usr/local/public_html/MYDOMAIN.COM/mail.php > /dev/null 2>&1
 
Back
Top