Hesk email function not working

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
JonP
Posts: 2
Joined: Mon Jun 22, 2015 5:17 pm

Hesk email function not working

Post by JonP »

URL etc. for script not posted as system is internal and only accessible via VPN.

Using latest version of hesk on Zend Server running on IBM i.

Running this script:

<?php
$to = "xxx@yyy.com";
$subject = "Testing Basic PHP Mail";
$txt = "Hello from the Mail system - sent at " . date("h:i:sa");
mail($to,$subject,$txt,$headers);
?>

Works perfectly to a variety of email destinations.

Hesk email is configured just to use php mail function but no mail ever arrives. Which doesn't make sense.

I'm not an email expert and have reached the end of my knowledge on the topic. I have checked off all of the items on hesk's FAQ but no help.

Any suggestions?
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Hesk email function not working

Post by Klemen »

HESK uses the same code, see inc/email_functions.inc.php line 294

Code: Select all

mail($to,$subject,$message,$headers);
Do you have access to any email delivery logs (Exim?)?
Do you have any SPAM filters active?

How about if you modify the code and just use :

Code: Select all

mail($to,$subject,$message);
Any difference?
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
JonP
Posts: 2
Joined: Mon Jun 22, 2015 5:17 pm

Re: Hesk email function not working

Post by JonP »

Removing the $headers seems to have fixed it for now - thank you so much!

Now that I know where the problem originates I can try and get a more permanent solution in by working out why the headers are wrong in the first place!
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Hesk email function not working

Post by Klemen »

The best place to look would be email server logs.

It could be that your server doesn't allow sending unauthenticated emails with "From" header set to your email address.

Switching HESK setting "Send emails using" to SMTP server and using a real email account may fix that.
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
Post Reply