Disable HESK email sending

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
ztank
Posts: 36
Joined: Thu Dec 19, 2024 3:59 pm

Disable HESK email sending

Post 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.
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Disable HESK email sending

Post 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;
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
ztank
Posts: 36
Joined: Thu Dec 19, 2024 3:59 pm

Re: Disable HESK email sending

Post 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.
Post Reply