Ok, I was getting the white screen when logging in as well. I use email for my server through google apps. I have my normal staff email accounts through there as well as the noreply account "
alerts@mydomain.com". Everything works as you would expect it to. This was done on an Ubuntu 11.04 server with PHPv5.3.5 built from source.
To get it working here's the code I changed.
Code: Select all
require("sendmail.php");
##########################################
$smtpserver = "ssl://smtp.gmail.com"; //SMTP server IP address
$smtpserverport =465; //SMTP port (I had to use alternate port)
That was to get it to login and authenticate for sending emails out through the google custom domain.
Obviously if you don't use google apps for email you'll change it to your server. And the "require("sendmail.php");" only goes on the first time you comment out the @mail code. After that it's automatically included. I also put sendmail.php in the admin directory, though I'm not sure that is required.
then in the admin_submit_ticket.php instead of
Code: Select all
require("sendmail.php");
##########################################
$smtpserver = "ssl://smtp.gmail.com"; //SMTP server IP address
$smtpserverport =465; //SMTP port
$smtpusermail = "yourfullemailaddress"; //SMTP email
$smtpemailto = $email; //
use this:
Code: Select all
/* @mail($tmpvar['email'],$hesklang['ticket_received'],$msg,$headers);*/
require("sendmail.php");
##########################################
$smtpserver = "ssl://smtp.gmail.com"; //SMTP server IP address
$smtpserverport =465; //SMTP port
$smtpusermail = "yourfullemailaddress"; //SMTP email
$smtpemailto = $tmpvar['email']; //
notice here in the $smtpusermail line it's actually $tmpvar['email']; rather than $email as the $email has not yet been created and isn't used for ticket received call.
In admin_reply_ticket.php use this code:
Code: Select all
/*@mail($ticket['email'],$hesklang['new_reply_staff'],$msg,$headers);*/
require("sendmail.php");
##########################################
$smtpserver = "ssl://smtp.gmail.com"; //SMTP server IP address
$smtpserverport =465; //SMTP port
$smtpusermail = "yourfullemailaddress"; //SMTP email
$smtpemailto = $ticket['email']; //
$smtpuser = "yourfullemailaddress"; //SMTP username
$smtppass = "passwordforyouraccount"; //SMTP password
$mailsubject = $hesklang['new_reply_staff']; //subject
$mailbody = $msg; //body
$mailtype = "TXT"; //
##########################################
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);
notice again that it's not $email or $orig_email for the $smtpmailto variable.
If you're unsure of what to put for $smtpemailto look at the original line, here is an example of what I'm talking about.
Code: Select all
@mail($tmpvar['email'],$hesklang['ticket_received'],$msg,$headers);
So if that's the line you commented out, the $smtpemailto = "" would be $smtpemailto = "$tmpvar['email'];
Also, I recommend to comment every instance of @mail line and replace with the code, look at the original @mail line and if it was $hesklang['new_reply_staff']; use as $mailsubject $mailsubject = $hesklang['new_reply_staff]; here's another example:
if the @mail line you commented out was this:
Code: Select all
@mail($email,$hesklang['new_ticket_submitted'],$msg,$headers);
then code you add in would look like this:
Code: Select all
/*@mail($ticket['email'],$hesklang['new_ticket_submitted'],$msg,$headers);*/
require("sendmail.php");
##########################################
$smtpserver = "ssl://smtp.gmail.com"; //SMTP server IP address
$smtpserverport =465; //SMTP port
$smtpusermail = "yourfullemailaddress"; //SMTP email
$smtpemailto = $ticket['email']; //
$smtpuser = "yourfullemailaddress"; //SMTP username
$smtppass = "passwordforyouraccount"; //SMTP password
$mailsubject = $hesklang['new_ticket_submitted']; //subject
$mailbody = $msg; //body
$mailtype = "TXT"; //
##########################################
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);
//true
$smtp->debug = false; //
if($smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype))
{
//echo "send successfully!!!<br>";
}
else
{
//echo "send unsuccessfully!!!!<br>";
}
and if it's the first @mail line you've changed, make sure you have:
after the /* @mail */
I hope it's clear, if not feel free to ask me for help. Thanks to the OP for such a wonderful script, and to Klemen for the Hesk script.