• Resolved dhumeurvegetale

    (@dhumeurvegetale)


    Hi everybody; i tried to install a cron job server side for not using wp-cron anymore. I installed WP CLI server side for CRON testing but it doesn’t work as DISABLE_WP_CRON is defined at TRUE. So i created a hook to send me a mail every hour and install it by WP Control plugin. The server support said the cron task is working but i didn’t received mail and in WP Control all task are overdues

    Here is my command server side:

    /”address to exe”/php /”address to wp cron file”/wp-cron.php

    Here is my hook:

    function myapp_cron_test()
    {
    mail(‘my email address’, ‘TEST CRON EVENT’, ‘test cron event by server cron job – OK’);
    }

    add_action( ‘humveg_cron_test’, ‘myapp_cron_test’ );

    why is it not working ? thanks….

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dhumeurvegetale

    (@dhumeurvegetale)

    One more thing:

    I added define(‘ALTERNATE_WP_CRON’, true); in my config file

    Thanks.

    Can you even send emails to yourself from your project? Even without a cronjob. Some hosting and/or email servers prevent the receipt of emails unless you set up a few things for this. You can test this, for example, by sending a user an email with their new password in wp-admin under Users. Does it not arrive? Then the problem is not with the cronjob but with the email theme. One solution could be to send emails via SMTP, e.g. with this: https://www.ads-software.com/plugins/wp-mail-smtp/

    Thread Starter dhumeurvegetale

    (@dhumeurvegetale)

    Hi @threadi ; Thanks for your advice but how can you explain that some plugins can send me mails using wp_mail function without any SMTP.. My problem is how can i test on my side if all the CRON tasks are done if i do it server side now…. because some plugins continues to mark all them as overdues.. the server support sent me the log to prove me that my CRON job server side is well executed every hours; is there a way to test this by mail or not, thanks.

    I can’t explain why some parts of your project can still send you emails. This has nothing to do with the plugins themselves, but rather with how emails are processed by your hoster and how they are received by your receiving email server. Only the support of these systems can help you with both.

    You can only check whether a system cronjob is technically running or not on the server system itself. In addition to the execution, you would also need to check what was executed as part of the cronjob. This can only be debugged on the server side, i.e. by your hoster’s support. If they can’t help you with this, you could also test the project elsewhere where you can test it yourself with other help if necessary.

    Thread Starter dhumeurvegetale

    (@dhumeurvegetale)

    Hi @threadi, thanks for your explanations, i removed the cron job server side because it wasn’t working at all and for the mails i’ve got SMTP Mailer and it work great. Have a nice day.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘server Cron Job Not working’ is closed to new replies.