Page 1 of 1

Hesk email function not working

Posted: Mon Jun 22, 2015 5:28 pm
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?

Re: Hesk email function not working

Posted: Mon Jun 22, 2015 5:47 pm
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?

Re: Hesk email function not working

Posted: Mon Jun 22, 2015 8:15 pm
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!

Re: Hesk email function not working

Posted: Tue Jun 23, 2015 10:57 am
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.