I just ran across an issue with emails not being generated after installing osTicket 1.6.rc4 on a Windows Server 2003 system. I found the source of the problem and a resolution that is working for me, so I thought I'd share it.
Initially emails were simply not being delivered. I set osTicket to display errors as follows:
on lines 42 and 43 of /scp/main.inc.php I changed this:
ini_set('display_errors',0);
ini_set('display_startup_errors',0);
to this:
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
On my Exchange 2007 server I also configured the receive connector for verbose protocol logging (in the EMC under the receive connector properties, general tab).
osTicket then displayed the following error at the top of the page when I attempted to post a reply to an open ticket:
Warning: mail() : SMTP server response: 501 5.1.7 Invalid address in C:\osticket\include\class.misc.php on line 79.
In my exchange protocol logs I could see that osTicket was trying to send the following SMTP command to my mail server:
MAIL FROM:>
Note that the mail command placed an extra set of angle brackets around the full email address.
Upon further investigation, it appears that PHP has a known issue with the mail() command on Windows systems (noted in the PHP documentation here: (http://www.php.net/manual/en/function.mail.php)). The issue restricts the format of the From: header to email address only. In other words the format "Friendly Name " does not work with Windows systems. My fix was to update the code to place only the email address in the From: header as follows:
Find line 67 in the file /include/class.misc.php. Change it from this:
$headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
to this:
$headers .= "From: ".$fromaddress.$eol;
Email notifications now work for me. I hope this helps someone else out too.