Page 1 of 1

Disable HESK email sending

Posted: Mon Dec 30, 2024 8:43 am
by ztank
Hello, I am on HESK v. 3.5.1.

Is it possible to disable email sending from HESK altogether?

I am aware of this knowledge article When does HESK send email notifications and to whom? which basically says it all but it seems there is no switch nowhere to turn emails off.
I though of eventually forcing HESK to use SMTP server in Settings > Email > Sending emails > Send email using option but if the SMTP server is not correctly configured it won't save the setting and defaults back to PHP mail().

Is there such an option?
Thanks.

Re: Disable HESK email sending

Posted: Wed Jan 01, 2025 2:59 pm
by Klemen
You can edit file /inc/email_functgions.inc.php

Find this code:

Code: Select all

function hesk_mail($to, $cc, $subject, $message, $html_message, $tracking_ID = null)
{
    global $hesk_settings, $hesklang;
and just below it add

Code: Select all

return true;
so it looks like this:

Code: Select all

function hesk_mail($to, $cc, $subject, $message, $html_message, $tracking_ID = null)
{
    global $hesk_settings, $hesklang;

    return true;

Re: Disable HESK email sending

Posted: Wed Jan 01, 2025 6:22 pm
by ztank
Hello,
I actually found a not so elegant way to disable emails by editing the file hesk_settings.inc.php and turnig to 1 the smtp setting:
$hesk_settings['smtp']=1;
I assume it would try to use an smtp server instead of PHP mail() but as it is mis-configured it fail.s Result: no mail being sent.
The only uncomfortable thing is that customers and agents/admins have a warning message that emails are not being sent whenever a task is supposed to trigger an email notification (ticket creation, reply posted, ticket assignation, etc.).
And one more thing, I also had to decrease down to 1 second this other setting:
$hesk_settings['smtp_timeout']=1;
or I have to wait 20 secs (default) every time hesk needs to sendo out an email.
Thanks.